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_DISPLAY_DISPLAY_CONTROLLER_H_ | 5 #ifndef ASH_DISPLAY_DISPLAY_CONTROLLER_H_ |
6 #define ASH_DISPLAY_DISPLAY_CONTROLLER_H_ | 6 #define ASH_DISPLAY_DISPLAY_CONTROLLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "ash/ash_export.h" | 11 #include "ash/ash_export.h" |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
16 #include "ui/aura/display_observer.h" | 16 #include "ui/gfx/display_observer.h" |
17 #include "ui/aura/display_manager.h" | |
18 #include "ui/gfx/display.h" | 17 #include "ui/gfx/display.h" |
19 | 18 |
20 namespace aura { | 19 namespace aura { |
21 class Display; | 20 class Display; |
22 class RootWindow; | 21 class RootWindow; |
23 } | 22 } |
24 | 23 |
25 namespace base { | 24 namespace base { |
26 class Value; | 25 class Value; |
27 template <typename T> class JSONValueConverter; | 26 template <typename T> class JSONValueConverter; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // The offset of the position of the secondary display. The offset is | 60 // The offset of the position of the secondary display. The offset is |
62 // based on the top/left edge of the primary display. | 61 // based on the top/left edge of the primary display. |
63 int offset; | 62 int offset; |
64 | 63 |
65 // Returns string representation of the layout for debugging/testing. | 64 // Returns string representation of the layout for debugging/testing. |
66 std::string ToString() const; | 65 std::string ToString() const; |
67 }; | 66 }; |
68 | 67 |
69 // DisplayController owns and maintains RootWindows for each attached | 68 // DisplayController owns and maintains RootWindows for each attached |
70 // display, keeping them in sync with display configuration changes. | 69 // display, keeping them in sync with display configuration changes. |
71 class ASH_EXPORT DisplayController : public aura::DisplayObserver { | 70 class ASH_EXPORT DisplayController : public gfx::DisplayObserver { |
72 public: | 71 public: |
73 class ASH_EXPORT Observer { | 72 class ASH_EXPORT Observer { |
74 public: | 73 public: |
75 // Invoked when the display configuration change is requested, | 74 // Invoked when the display configuration change is requested, |
76 // but before the change is applied to aura/ash. | 75 // but before the change is applied to aura/ash. |
77 virtual void OnDisplayConfigurationChanging() = 0; | 76 virtual void OnDisplayConfigurationChanging() = 0; |
78 | 77 |
79 protected: | 78 protected: |
80 virtual ~Observer() {} | 79 virtual ~Observer() {} |
81 }; | 80 }; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 118 |
120 // Returns all root windows. In non extended desktop mode, this | 119 // Returns all root windows. In non extended desktop mode, this |
121 // returns the primary root window only. | 120 // returns the primary root window only. |
122 std::vector<aura::RootWindow*> GetAllRootWindows(); | 121 std::vector<aura::RootWindow*> GetAllRootWindows(); |
123 | 122 |
124 // Returns all oot window controllers. In non extended desktop | 123 // Returns all oot window controllers. In non extended desktop |
125 // mode, this return a RootWindowController for the primary root window only. | 124 // mode, this return a RootWindowController for the primary root window only. |
126 std::vector<internal::RootWindowController*> GetAllRootWindowControllers(); | 125 std::vector<internal::RootWindowController*> GetAllRootWindowControllers(); |
127 | 126 |
128 // Returns the current overscan insets for the specified |display_id|. See | 127 // Returns the current overscan insets for the specified |display_id|. See |
129 // multi_display_manager.h for the details. | 128 // display_manager.h for the details. |
130 gfx::Insets GetOverscanInsets(int64 display_id) const; | 129 gfx::Insets GetOverscanInsets(int64 display_id) const; |
131 | 130 |
132 const DisplayLayout& default_display_layout() const { | 131 const DisplayLayout& default_display_layout() const { |
133 return default_display_layout_; | 132 return default_display_layout_; |
134 } | 133 } |
135 void SetDefaultDisplayLayout(const DisplayLayout& layout); | 134 void SetDefaultDisplayLayout(const DisplayLayout& layout); |
136 | 135 |
137 // Sets/gets the display layout for the specified display or display | 136 // Sets/gets the display layout for the specified display or display |
138 // name. Getter returns the default value in case it doesn't have | 137 // name. Getter returns the default value in case it doesn't have |
139 // its own layout yet. | 138 // its own layout yet. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 int64 desired_primary_display_id_; | 172 int64 desired_primary_display_id_; |
174 | 173 |
175 ObserverList<Observer> observers_; | 174 ObserverList<Observer> observers_; |
176 | 175 |
177 DISALLOW_COPY_AND_ASSIGN(DisplayController); | 176 DISALLOW_COPY_AND_ASSIGN(DisplayController); |
178 }; | 177 }; |
179 | 178 |
180 } // namespace ash | 179 } // namespace ash |
181 | 180 |
182 #endif // ASH_DISPLAY_DISPLAY_CONTROLLER_H_ | 181 #endif // ASH_DISPLAY_DISPLAY_CONTROLLER_H_ |
OLD | NEW |