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/accelerometer/accelerometer_observer.h" | |
11 #include "ash/ash_export.h" | 12 #include "ash/ash_export.h" |
12 #include "ash/display/display_info.h" | 13 #include "ash/display/display_info.h" |
13 #include "ash/display/display_layout.h" | 14 #include "ash/display/display_layout.h" |
14 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
15 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
16 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
17 #include "ui/gfx/display.h" | 18 #include "ui/gfx/display.h" |
18 | 19 |
19 #if defined(OS_CHROMEOS) | 20 #if defined(OS_CHROMEOS) |
20 #include "ui/display/chromeos/output_configurator.h" | 21 #include "ui/display/chromeos/output_configurator.h" |
21 #endif | 22 #endif |
22 | 23 |
23 namespace gfx { | 24 namespace gfx { |
24 class Display; | 25 class Display; |
25 class Insets; | 26 class Insets; |
26 class Rect; | 27 class Rect; |
27 class Screen; | 28 class Screen; |
29 class Vector3dF; | |
28 } | 30 } |
29 | 31 |
30 namespace ash { | 32 namespace ash { |
31 class AcceleratorControllerTest; | 33 class AcceleratorControllerTest; |
32 class DisplayController; | 34 class DisplayController; |
33 class ScreenAsh; | 35 class ScreenAsh; |
34 | 36 |
35 namespace test { | 37 namespace test { |
36 class DisplayManagerTestApi; | 38 class DisplayManagerTestApi; |
37 class SystemGestureEventFilterTest; | 39 class SystemGestureEventFilterTest; |
38 } | 40 } |
39 namespace internal { | 41 namespace internal { |
40 class DisplayLayoutStore; | 42 class DisplayLayoutStore; |
41 | 43 |
42 // DisplayManager maintains the current display configurations, | 44 // DisplayManager maintains the current display configurations, |
43 // and notifies observers when configuration changes. | 45 // and notifies observers when configuration changes. |
44 // | 46 // |
45 // TODO(oshima): Make this non internal. | 47 // TODO(oshima): Make this non internal. |
46 class ASH_EXPORT DisplayManager | 48 class ASH_EXPORT DisplayManager : |
47 #if defined(OS_CHROMEOS) | 49 #if defined(OS_CHROMEOS) |
48 : public ui::OutputConfigurator::SoftwareMirroringController | 50 public ui::OutputConfigurator::SoftwareMirroringController, |
49 #endif | 51 #endif |
50 { | 52 public ash::AccelerometerObserver { |
51 public: | 53 public: |
52 class ASH_EXPORT Delegate { | 54 class ASH_EXPORT Delegate { |
53 public: | 55 public: |
54 virtual ~Delegate() {} | 56 virtual ~Delegate() {} |
55 | 57 |
56 // Create or updates the non desktop window with |display_info|. | 58 // Create or updates the non desktop window with |display_info|. |
57 virtual void CreateOrUpdateNonDesktopDisplay( | 59 virtual void CreateOrUpdateNonDesktopDisplay( |
58 const DisplayInfo& display_info) = 0; | 60 const DisplayInfo& display_info) = 0; |
59 | 61 |
60 // Closes the mirror window if exists. | 62 // Closes the mirror window if exists. |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
272 bool UpdateDisplayBounds(int64 display_id, | 274 bool UpdateDisplayBounds(int64 display_id, |
273 const gfx::Rect& new_bounds); | 275 const gfx::Rect& new_bounds); |
274 | 276 |
275 // Creates mirror window if the software mirror mode is enabled. | 277 // Creates mirror window if the software mirror mode is enabled. |
276 // This is used only for bootstrap. | 278 // This is used only for bootstrap. |
277 void CreateMirrorWindowIfAny(); | 279 void CreateMirrorWindowIfAny(); |
278 | 280 |
279 // Create a screen instance to be used during shutdown. | 281 // Create a screen instance to be used during shutdown. |
280 void CreateScreenForShutdown() const; | 282 void CreateScreenForShutdown() const; |
281 | 283 |
284 // ash::AccelerometerObserver: | |
285 virtual void OnAccelerometerUpdated(const gfx::Vector3dF& base, | |
286 const gfx::Vector3dF& lid) OVERRIDE; | |
oshima
2014/04/01 00:57:03
Hmm, I don't think this should belong here. (I sho
flackr
2014/04/01 01:46:31
Okay, so something else to observe accelerometer u
oshima
2014/04/01 14:52:50
sgtm. I don't have strong preference as to where/w
| |
287 | |
282 private: | 288 private: |
283 FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, ConvertPoint); | 289 FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, ConvertPoint); |
284 FRIEND_TEST_ALL_PREFIXES(DisplayManagerTest, TestNativeDisplaysChanged); | 290 FRIEND_TEST_ALL_PREFIXES(DisplayManagerTest, TestNativeDisplaysChanged); |
285 FRIEND_TEST_ALL_PREFIXES(DisplayManagerTest, | 291 FRIEND_TEST_ALL_PREFIXES(DisplayManagerTest, |
286 NativeDisplaysChangedAfterPrimaryChange); | 292 NativeDisplaysChangedAfterPrimaryChange); |
287 FRIEND_TEST_ALL_PREFIXES(DisplayManagerTest, AutomaticOverscanInsets); | 293 FRIEND_TEST_ALL_PREFIXES(DisplayManagerTest, AutomaticOverscanInsets); |
288 friend class ash::AcceleratorControllerTest; | 294 friend class ash::AcceleratorControllerTest; |
289 friend class test::DisplayManagerTestApi; | 295 friend class test::DisplayManagerTestApi; |
290 friend class test::SystemGestureEventFilterTest; | 296 friend class test::SystemGestureEventFilterTest; |
291 friend class DisplayManagerTest; | 297 friend class DisplayManagerTest; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
362 int64 mirrored_display_id_; | 368 int64 mirrored_display_id_; |
363 gfx::Display non_desktop_display_; | 369 gfx::Display non_desktop_display_; |
364 | 370 |
365 DISALLOW_COPY_AND_ASSIGN(DisplayManager); | 371 DISALLOW_COPY_AND_ASSIGN(DisplayManager); |
366 }; | 372 }; |
367 | 373 |
368 } // namespace internal | 374 } // namespace internal |
369 } // namespace ash | 375 } // namespace ash |
370 | 376 |
371 #endif // ASH_DISPLAY_DISPLAY_MANAGER_H_ | 377 #endif // ASH_DISPLAY_DISPLAY_MANAGER_H_ |
OLD | NEW |