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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 } | 53 } |
54 | 54 |
55 // DisplayManager maintains the current display configurations, | 55 // DisplayManager maintains the current display configurations, |
56 // and notifies observers when configuration changes. | 56 // and notifies observers when configuration changes. |
57 // | 57 // |
58 // TODO(oshima): Make this non internal. | 58 // TODO(oshima): Make this non internal. |
59 class ASH_EXPORT DisplayManager | 59 class ASH_EXPORT DisplayManager |
60 #if defined(OS_CHROMEOS) | 60 #if defined(OS_CHROMEOS) |
61 : public ui::DisplayConfigurator::SoftwareMirroringController | 61 : public ui::DisplayConfigurator::SoftwareMirroringController |
62 #endif | 62 #endif |
63 { | 63 { |
64 public: | 64 public: |
65 class ASH_EXPORT Delegate { | 65 class ASH_EXPORT Delegate { |
66 public: | 66 public: |
67 virtual ~Delegate() {} | 67 virtual ~Delegate() {} |
68 | 68 |
69 // Create or updates the mirroring window with |display_info_list|. | 69 // Create or updates the mirroring window with |display_info_list|. |
70 virtual void CreateOrUpdateMirroringDisplay( | 70 virtual void CreateOrUpdateMirroringDisplay( |
71 const DisplayInfoList& display_info_list) = 0; | 71 const DisplayInfoList& display_info_list) = 0; |
72 | 72 |
73 // Closes the mirror window if not necessary. | 73 // Closes the mirror window if not necessary. |
(...skipping 20 matching lines...) Expand all Loading... |
94 // The display ID for a virtual display assigned to a unified desktop. | 94 // The display ID for a virtual display assigned to a unified desktop. |
95 static int64_t kUnifiedDisplayId; | 95 static int64_t kUnifiedDisplayId; |
96 | 96 |
97 DisplayManager(); | 97 DisplayManager(); |
98 #if defined(OS_CHROMEOS) | 98 #if defined(OS_CHROMEOS) |
99 ~DisplayManager() override; | 99 ~DisplayManager() override; |
100 #else | 100 #else |
101 virtual ~DisplayManager(); | 101 virtual ~DisplayManager(); |
102 #endif | 102 #endif |
103 | 103 |
104 DisplayLayoutStore* layout_store() { | 104 DisplayLayoutStore* layout_store() { return layout_store_.get(); } |
105 return layout_store_.get(); | |
106 } | |
107 | 105 |
108 void set_delegate(Delegate* delegate) { delegate_ = delegate; } | 106 void set_delegate(Delegate* delegate) { delegate_ = delegate; } |
109 | 107 |
110 // When set to true, the DisplayManager calls OnDisplayMetricsChanged | 108 // When set to true, the DisplayManager calls OnDisplayMetricsChanged |
111 // even if the display's bounds didn't change. Used to swap primary | 109 // even if the display's bounds didn't change. Used to swap primary |
112 // display. | 110 // display. |
113 void set_force_bounds_changed(bool force_bounds_changed) { | 111 void set_force_bounds_changed(bool force_bounds_changed) { |
114 force_bounds_changed_ = force_bounds_changed; | 112 force_bounds_changed_ = force_bounds_changed; |
115 } | 113 } |
116 | 114 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 int64_t GetDisplayIdForUIScaling() const; | 277 int64_t GetDisplayIdForUIScaling() const; |
280 | 278 |
281 // Change the mirror mode. | 279 // Change the mirror mode. |
282 void SetMirrorMode(bool mirrored); | 280 void SetMirrorMode(bool mirrored); |
283 | 281 |
284 // Used to emulate display change when run in a desktop environment instead | 282 // Used to emulate display change when run in a desktop environment instead |
285 // of on a device. | 283 // of on a device. |
286 void AddRemoveDisplay(); | 284 void AddRemoveDisplay(); |
287 void ToggleDisplayScaleFactor(); | 285 void ToggleDisplayScaleFactor(); |
288 | 286 |
289 // SoftwareMirroringController override: | 287 // SoftwareMirroringController override: |
290 #if defined(OS_CHROMEOS) | 288 #if defined(OS_CHROMEOS) |
291 void SetSoftwareMirroring(bool enabled) override; | 289 void SetSoftwareMirroring(bool enabled) override; |
292 bool SoftwareMirroringEnabled() const override; | 290 bool SoftwareMirroringEnabled() const override; |
293 #endif | 291 #endif |
294 | 292 |
295 // Sets/gets default multi display mode. | 293 // Sets/gets default multi display mode. |
296 void SetDefaultMultiDisplayModeForCurrentDisplays(MultiDisplayMode mode); | 294 void SetDefaultMultiDisplayModeForCurrentDisplays(MultiDisplayMode mode); |
297 MultiDisplayMode current_default_multi_display_mode() const { | 295 MultiDisplayMode current_default_multi_display_mode() const { |
298 return current_default_multi_display_mode_; | 296 return current_default_multi_display_mode_; |
299 } | 297 } |
(...skipping 20 matching lines...) Expand all Loading... |
320 aura::Window* drag_source) const; | 318 aura::Window* drag_source) const; |
321 | 319 |
322 // Create a screen instance to be used during shutdown. | 320 // Create a screen instance to be used during shutdown. |
323 void CreateScreenForShutdown() const; | 321 void CreateScreenForShutdown() const; |
324 | 322 |
325 // A unit test may change the internal display id (which never happens on | 323 // A unit test may change the internal display id (which never happens on |
326 // a real device). This will update the mode list for internal display | 324 // a real device). This will update the mode list for internal display |
327 // for this test scenario. | 325 // for this test scenario. |
328 void UpdateInternalDisplayModeListForTest(); | 326 void UpdateInternalDisplayModeListForTest(); |
329 | 327 |
330 private: | 328 private: |
331 FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, ConvertPoint); | 329 FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, ConvertPoint); |
332 FRIEND_TEST_ALL_PREFIXES(DisplayManagerTest, TestNativeDisplaysChanged); | 330 FRIEND_TEST_ALL_PREFIXES(DisplayManagerTest, TestNativeDisplaysChanged); |
333 FRIEND_TEST_ALL_PREFIXES(DisplayManagerTest, | 331 FRIEND_TEST_ALL_PREFIXES(DisplayManagerTest, |
334 NativeDisplaysChangedAfterPrimaryChange); | 332 NativeDisplaysChangedAfterPrimaryChange); |
335 FRIEND_TEST_ALL_PREFIXES(DisplayManagerTest, AutomaticOverscanInsets); | 333 FRIEND_TEST_ALL_PREFIXES(DisplayManagerTest, AutomaticOverscanInsets); |
336 FRIEND_TEST_ALL_PREFIXES(DisplayManagerTest, Rotate); | 334 FRIEND_TEST_ALL_PREFIXES(DisplayManagerTest, Rotate); |
337 friend class AcceleratorControllerTest; | 335 friend class AcceleratorControllerTest; |
338 friend class DisplayManagerTest; | 336 friend class DisplayManagerTest; |
339 friend class chromeos::DisplayNotificationsTest; | 337 friend class chromeos::DisplayNotificationsTest; |
340 friend class test::AshTestBase; | 338 friend class test::AshTestBase; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 bool unified_desktop_enabled_; | 442 bool unified_desktop_enabled_; |
445 | 443 |
446 base::WeakPtrFactory<DisplayManager> weak_ptr_factory_; | 444 base::WeakPtrFactory<DisplayManager> weak_ptr_factory_; |
447 | 445 |
448 DISALLOW_COPY_AND_ASSIGN(DisplayManager); | 446 DISALLOW_COPY_AND_ASSIGN(DisplayManager); |
449 }; | 447 }; |
450 | 448 |
451 } // namespace ash | 449 } // namespace ash |
452 | 450 |
453 #endif // ASH_DISPLAY_DISPLAY_MANAGER_H_ | 451 #endif // ASH_DISPLAY_DISPLAY_MANAGER_H_ |
OLD | NEW |