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_MANAGER_H_ | 5 #ifndef ASH_DISPLAY_DISPLAY_MANAGER_H_ |
6 #define ASH_DISPLAY_DISPLAY_MANAGER_H_ | 6 #define ASH_DISPLAY_DISPLAY_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "ash/ash_export.h" | 11 #include "ash/ash_export.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
14 #include "ui/aura/root_window_observer.h" | 14 #include "ui/aura/root_window_observer.h" |
15 #include "ui/aura/window.h" | 15 #include "ui/aura/window.h" |
16 | 16 |
17 namespace gfx { | 17 namespace gfx { |
18 class Display; | 18 class Display; |
19 class Insets; | 19 class Insets; |
20 class Rect; | 20 class Rect; |
21 } | 21 } |
22 | 22 |
23 namespace ash { | 23 namespace ash { |
24 class AcceleratorControllerTest; | 24 class AcceleratorControllerTest; |
25 namespace test { | 25 namespace test { |
26 class DisplayManagerTestApi; | 26 class DisplayManagerTestApi; |
27 class SystemGestureEventFilterTest; | 27 class SystemGestureEventFilterTest; |
28 } | 28 } |
29 namespace internal { | 29 namespace internal { |
| 30 class DisplayManagerDelegate; |
30 | 31 |
31 // DisplayManager maintains the current display configurations, | 32 // DisplayManager maintains the current display configurations, |
32 // and notifies observers when configuration changes. | 33 // and notifies observers when configuration changes. |
33 // This is exported for unittest. | 34 // This is exported for unittest. |
34 // | 35 // |
35 // TODO(oshima): gfx::Screen needs to return translated coordinates | 36 // TODO(oshima): gfx::Screen needs to return translated coordinates |
36 // if the root window is translated. crbug.com/119268. | 37 // if the root window is translated. crbug.com/119268. |
37 class ASH_EXPORT DisplayManager : public aura::RootWindowObserver { | 38 class ASH_EXPORT DisplayManager : public aura::RootWindowObserver { |
38 public: | 39 public: |
39 DisplayManager(); | 40 DisplayManager(DisplayManagerDelegate* delegate); |
40 virtual ~DisplayManager(); | 41 virtual ~DisplayManager(); |
41 | 42 |
42 // Used to emulate display change when run in a desktop environment instead | 43 // Used to emulate display change when run in a desktop environment instead |
43 // of on a device. | 44 // of on a device. |
44 static void CycleDisplay(); | 45 static void CycleDisplay(); |
45 static void ToggleDisplayScale(); | 46 static void ToggleDisplayScale(); |
46 | 47 |
47 // When set to true, the MonitorManager calls OnDisplayBoundsChanged | 48 // When set to true, the MonitorManager calls OnDisplayBoundsChanged |
48 // even if the display's bounds didn't change. Used to swap primary | 49 // even if the display's bounds didn't change. Used to swap primary |
49 // display. | 50 // display. |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 int64 internal_display_id_; | 177 int64 internal_display_id_; |
177 | 178 |
178 // An internal display cache used when the internal display is disconnectd. | 179 // An internal display cache used when the internal display is disconnectd. |
179 scoped_ptr<gfx::Display> internal_display_; | 180 scoped_ptr<gfx::Display> internal_display_; |
180 | 181 |
181 bool force_bounds_changed_; | 182 bool force_bounds_changed_; |
182 | 183 |
183 // The mapping from the display ID to its internal data. | 184 // The mapping from the display ID to its internal data. |
184 std::map<int64, DisplayInfo> display_info_; | 185 std::map<int64, DisplayInfo> display_info_; |
185 | 186 |
| 187 DisplayManagerDelegate* delegate_; |
| 188 |
186 DISALLOW_COPY_AND_ASSIGN(DisplayManager); | 189 DISALLOW_COPY_AND_ASSIGN(DisplayManager); |
187 }; | 190 }; |
188 | 191 |
189 extern const aura::WindowProperty<int64>* const kDisplayIdKey; | 192 extern const aura::WindowProperty<int64>* const kDisplayIdKey; |
190 | 193 |
191 } // namespace internal | 194 } // namespace internal |
192 } // namespace ash | 195 } // namespace ash |
193 | 196 |
194 #endif // ASH_DISPLAY_DISPLAY_MANAGER_H_ | 197 #endif // ASH_DISPLAY_DISPLAY_MANAGER_H_ |
OLD | NEW |