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 25 matching lines...) Expand all Loading... |
36 | 36 |
37 namespace gfx { | 37 namespace gfx { |
38 class Insets; | 38 class Insets; |
39 class Rect; | 39 class Rect; |
40 } | 40 } |
41 | 41 |
42 namespace ash { | 42 namespace ash { |
43 using DisplayInfoList = std::vector<display::ManagedDisplayInfo>; | 43 using DisplayInfoList = std::vector<display::ManagedDisplayInfo>; |
44 | 44 |
45 namespace test { | 45 namespace test { |
46 class AshTestBase; | |
47 class DisplayManagerTestApi; | 46 class DisplayManagerTestApi; |
48 } | 47 } |
49 | 48 |
50 // DisplayManager maintains the current display configurations, | 49 // DisplayManager maintains the current display configurations, |
51 // and notifies observers when configuration changes. | 50 // and notifies observers when configuration changes. |
52 // | 51 // |
53 // TODO(oshima): Make this non internal. | 52 // TODO(oshima): Make this non internal. |
54 class ASH_EXPORT DisplayManager | 53 class ASH_EXPORT DisplayManager |
55 #if defined(OS_CHROMEOS) | 54 #if defined(OS_CHROMEOS) |
56 : public ui::DisplayConfigurator::SoftwareMirroringController | 55 : public ui::DisplayConfigurator::SoftwareMirroringController |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 | 340 |
342 // Notifies observers of display configuration changes. | 341 // Notifies observers of display configuration changes. |
343 void NotifyMetricsChanged(const display::Display& display, uint32_t metrics); | 342 void NotifyMetricsChanged(const display::Display& display, uint32_t metrics); |
344 void NotifyDisplayAdded(const display::Display& display); | 343 void NotifyDisplayAdded(const display::Display& display); |
345 void NotifyDisplayRemoved(const display::Display& display); | 344 void NotifyDisplayRemoved(const display::Display& display); |
346 | 345 |
347 // Delegated from the Screen implementation. | 346 // Delegated from the Screen implementation. |
348 void AddObserver(display::DisplayObserver* observer); | 347 void AddObserver(display::DisplayObserver* observer); |
349 void RemoveObserver(display::DisplayObserver* observer); | 348 void RemoveObserver(display::DisplayObserver* observer); |
350 | 349 |
| 350 // Returns a display::Display object for a secondary display if it exists |
| 351 // or returns invalid display if there is no secondary display. |
| 352 // TODO(rjkroege): Display swapping is an obsolete feature pre-dating |
| 353 // multi-display support so remove it. |
| 354 const display::Display& GetSecondaryDisplay() const; |
| 355 |
351 private: | 356 private: |
352 FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, ConvertPoint); | |
353 FRIEND_TEST_ALL_PREFIXES(DisplayManagerTest, TestNativeDisplaysChanged); | |
354 FRIEND_TEST_ALL_PREFIXES(DisplayManagerTest, | |
355 NativeDisplaysChangedAfterPrimaryChange); | |
356 FRIEND_TEST_ALL_PREFIXES(DisplayManagerTest, AutomaticOverscanInsets); | |
357 FRIEND_TEST_ALL_PREFIXES(DisplayManagerTest, Rotate); | |
358 friend class DisplayManagerTest; | |
359 friend class test::AshTestBase; | |
360 friend class test::DisplayManagerTestApi; | 357 friend class test::DisplayManagerTestApi; |
361 | 358 |
362 bool software_mirroring_enabled() const { | 359 bool software_mirroring_enabled() const { |
363 return multi_display_mode_ == MIRRORING; | 360 return multi_display_mode_ == MIRRORING; |
364 }; | 361 }; |
365 | 362 |
366 void set_change_display_upon_host_resize(bool value) { | 363 void set_change_display_upon_host_resize(bool value) { |
367 change_display_upon_host_resize_ = value; | 364 change_display_upon_host_resize_ = value; |
368 } | 365 } |
369 | 366 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 base::ObserverList<display::DisplayObserver> observers_; | 474 base::ObserverList<display::DisplayObserver> observers_; |
478 | 475 |
479 base::WeakPtrFactory<DisplayManager> weak_ptr_factory_; | 476 base::WeakPtrFactory<DisplayManager> weak_ptr_factory_; |
480 | 477 |
481 DISALLOW_COPY_AND_ASSIGN(DisplayManager); | 478 DISALLOW_COPY_AND_ASSIGN(DisplayManager); |
482 }; | 479 }; |
483 | 480 |
484 } // namespace ash | 481 } // namespace ash |
485 | 482 |
486 #endif // ASH_DISPLAY_DISPLAY_MANAGER_H_ | 483 #endif // ASH_DISPLAY_DISPLAY_MANAGER_H_ |
OLD | NEW |