OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_CHROMEOS_DISPLAY_PRIMARY_DISPLAY_SWITCH_OBSERVER_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_DISPLAY_PRIMARY_DISPLAY_SWITCH_OBSERVER_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/compiler_specific.h" | |
10 #include "ui/aura/root_window_observer.h" | |
11 #include "ui/aura/window_observer.h" | |
12 | |
13 namespace aura { | |
14 class RootWindow; | |
15 } | |
16 | |
17 namespace gfx { | |
18 class Point; | |
19 } | |
20 | |
21 namespace chromeos { | |
22 | |
23 // PrimaryDisplaySwitchObserver observes the change of the primary/secondary | |
24 // displays and store the current primary display ID into the local preference. | |
25 class PrimaryDisplaySwitchObserver : public aura::RootWindowObserver, | |
26 public aura::WindowObserver { | |
27 public: | |
28 PrimaryDisplaySwitchObserver(); | |
29 virtual ~PrimaryDisplaySwitchObserver(); | |
30 | |
31 protected: | |
32 // aura::RootWindowObserver overrides: | |
33 virtual void OnRootWindowMoved(const aura::RootWindow* root_window, | |
34 const gfx::Point& new_origin) OVERRIDE; | |
35 // aura::WindowObserver overrides: | |
36 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; | |
37 | |
38 aura::RootWindow* primary_root_; | |
39 | |
40 DISALLOW_COPY_AND_ASSIGN(PrimaryDisplaySwitchObserver); | |
41 }; | |
42 | |
43 } // namespace chromeos | |
44 | |
45 #endif // CHROME_BROWSER_CHROMEOS_DISPLAY_PRIMARY_DISPLAY_SWITCH_OBSERVER_H_ | |
OLD | NEW |