| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/display/primary_display_switch_observer.h" | 5 #include "chrome/browser/chromeos/display/primary_display_switch_observer.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "chrome/browser/chromeos/display/display_preferences.h" | 8 #include "chrome/browser/chromeos/display/display_preferences.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/profiles/profile_manager.h" | 10 #include "chrome/browser/profiles/profile_manager.h" |
| 11 #include "ui/aura/root_window.h" | 11 #include "ui/aura/root_window.h" |
| 12 #include "ui/gfx/display.h" | 12 #include "ui/gfx/display.h" |
| 13 #include "ui/gfx/screen.h" | 13 #include "ui/gfx/screen.h" |
| 14 | 14 |
| 15 namespace chromeos { | 15 namespace chromeos { |
| 16 | 16 |
| 17 void PrimaryDisplaySwitchObserver::OnRootWindowMoved( | 17 void PrimaryDisplaySwitchObserver::OnRootWindowMoved( |
| 18 const aura::RootWindow* root_window, const gfx::Point& new_origin) { | 18 const aura::RootWindow* root_window, const gfx::Point& new_origin) { |
| 19 StorePrimaryDisplayIDPref(gfx::Screen::GetPrimaryDisplay().id()); | 19 StorePrimaryDisplayIDPref(ash::Shell::GetScreen()->GetPrimaryDisplay().id()); |
| 20 } | 20 } |
| 21 | 21 |
| 22 PrimaryDisplaySwitchObserver::PrimaryDisplaySwitchObserver() | 22 PrimaryDisplaySwitchObserver::PrimaryDisplaySwitchObserver() |
| 23 : primary_root_(ash::Shell::GetInstance()->GetPrimaryRootWindow()) { | 23 : primary_root_(ash::Shell::GetInstance()->GetPrimaryRootWindow()) { |
| 24 primary_root_->AddRootWindowObserver(this); | 24 primary_root_->AddRootWindowObserver(this); |
| 25 } | 25 } |
| 26 | 26 |
| 27 PrimaryDisplaySwitchObserver::~PrimaryDisplaySwitchObserver() { | 27 PrimaryDisplaySwitchObserver::~PrimaryDisplaySwitchObserver() { |
| 28 primary_root_->RemoveRootWindowObserver(this); | 28 primary_root_->RemoveRootWindowObserver(this); |
| 29 } | 29 } |
| 30 | 30 |
| 31 } // namespace chromeos | 31 } // namespace chromeos |
| OLD | NEW |