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 #ifndef ASH_MONITOR_MONITOR_CONTROLLER_H_ | 5 #ifndef ASH_DISPLAY_DISPLAY_CONTROLLER_H_ |
6 #define ASH_MONITOR_MONITOR_CONTROLLER_H_ | 6 #define ASH_DISPLAY_DISPLAY_CONTROLLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "ash/ash_export.h" | 12 #include "ash/ash_export.h" |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "ui/aura/display_observer.h" | 15 #include "ui/aura/display_observer.h" |
16 #include "ui/aura/monitor_manager.h" | 16 #include "ui/aura/display_manager.h" |
17 | 17 |
18 namespace aura { | 18 namespace aura { |
19 class Display; | 19 class Display; |
20 class RootWindow; | 20 class RootWindow; |
21 } | 21 } |
22 | 22 |
23 namespace ash { | 23 namespace ash { |
24 namespace internal { | 24 namespace internal { |
25 class RootWindowController; | 25 class RootWindowController; |
26 | 26 |
27 // MonitorController owns and maintains RootWindows for each attached | 27 // DisplayController owns and maintains RootWindows for each attached |
28 // display, keeping them in sync with display configuration changes. | 28 // display, keeping them in sync with display configuration changes. |
29 // TODO(oshima): Rename MonitorXXX to DisplayXXX. | 29 // TODO(oshima): Rename DisplayXXX to DisplayXXX. |
30 class ASH_EXPORT MonitorController : public aura::DisplayObserver { | 30 class ASH_EXPORT DisplayController : public aura::DisplayObserver { |
31 public: | 31 public: |
32 // Layout options where the secondary monitor should be positioned. | 32 // Layout options where the secondary display should be positioned. |
33 enum SecondaryDisplayLayout { | 33 enum SecondaryDisplayLayout { |
34 TOP, | 34 TOP, |
35 RIGHT, | 35 RIGHT, |
36 BOTTOM, | 36 BOTTOM, |
37 LEFT | 37 LEFT |
38 }; | 38 }; |
39 | 39 |
40 MonitorController(); | 40 DisplayController(); |
41 virtual ~MonitorController(); | 41 virtual ~DisplayController(); |
42 | 42 |
43 // Initializes primary display. | 43 // Initializes primary display. |
44 void InitPrimaryDisplay(); | 44 void InitPrimaryDisplay(); |
45 | 45 |
46 // Initialize secondary display. This is separated because in non | 46 // Initialize secondary display. This is separated because in non |
47 // extended desktop mode, this creates background widgets, which | 47 // extended desktop mode, this creates background widgets, which |
48 // requires other controllers. | 48 // requires other controllers. |
49 void InitSecondaryDisplays(); | 49 void InitSecondaryDisplays(); |
50 | 50 |
51 // Returns the root window for primary display. | 51 // Returns the root window for primary display. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 private: | 94 private: |
95 // Creates a root window for |display| and stores it in the |root_windows_| | 95 // Creates a root window for |display| and stores it in the |root_windows_| |
96 // map. | 96 // map. |
97 aura::RootWindow* AddRootWindowForDisplay(const gfx::Display& display); | 97 aura::RootWindow* AddRootWindowForDisplay(const gfx::Display& display); |
98 | 98 |
99 std::map<int, aura::RootWindow*> root_windows_; | 99 std::map<int, aura::RootWindow*> root_windows_; |
100 | 100 |
101 SecondaryDisplayLayout secondary_display_layout_; | 101 SecondaryDisplayLayout secondary_display_layout_; |
102 | 102 |
103 DISALLOW_COPY_AND_ASSIGN(MonitorController); | 103 DISALLOW_COPY_AND_ASSIGN(DisplayController); |
104 }; | 104 }; |
105 | 105 |
106 } // namespace internal | 106 } // namespace internal |
107 } // namespace ash | 107 } // namespace ash |
108 | 108 |
109 #endif // ASH_MONITOR_MONITOR_CONTROLLER_H_ | 109 #endif // ASH_DISPLAY_DISPLAY_CONTROLLER_H_ |
OLD | NEW |