Chromium Code Reviews| Index: ash/display/multi_display_manager.h |
| diff --git a/ash/display/multi_display_manager.h b/ash/display/multi_display_manager.h |
| index 248885db4d785427090517b6197a124cf842c5f5..4c3722faa3c740534c12055b56bccb2999690191 100644 |
| --- a/ash/display/multi_display_manager.h |
| +++ b/ash/display/multi_display_manager.h |
| @@ -24,6 +24,7 @@ class Rect; |
| namespace ash { |
| namespace test { |
| class AcceleratorControllerTest; |
| +class AshTestBase; |
| class SystemGestureEventFilterTest; |
| } |
| namespace internal { |
| @@ -45,10 +46,20 @@ class ASH_EXPORT MultiDisplayManager : public aura::DisplayManager, |
| static void CycleDisplay(); |
| static void ToggleDisplayScale(); |
| + // When set to ture, the MultiMonitorManager calls OnDisplayBoundsChanged |
|
sky
2012/09/18 03:52:47
true
|
| + // even if the display's bounds didn't change. Used to swap primary |
| + // display. |
| + void set_force_bounds_changed(bool force_bounds_changed) { |
| + force_bounds_changed_ = force_bounds_changed; |
| + } |
| + |
| // Detects the internal display's ID, and stores gfx::Display |
| // in the cache, if any. |
| void InitInternalDisplayInfo(); |
| + // True if the given |display| is currently connected. |
| + bool IsActiveDisplay(const gfx::Display& display) const; |
| + |
| // True if there is an internal display. |
| bool HasInternalDisplay() const; |
| @@ -75,7 +86,7 @@ class ASH_EXPORT MultiDisplayManager : public aura::DisplayManager, |
| const aura::Window* window) const OVERRIDE; |
| virtual const gfx::Display& GetDisplayMatching( |
| const gfx::Rect& match_rect)const OVERRIDE; |
| - virtual std::string GetDisplayNameAt(size_t index) OVERRIDE; |
| + virtual std::string GetDisplayNameFor(const gfx::Display& display) OVERRIDE; |
| // RootWindowObserver overrides: |
| virtual void OnRootWindowResized(const aura::RootWindow* root, |
| @@ -85,30 +96,42 @@ class ASH_EXPORT MultiDisplayManager : public aura::DisplayManager, |
| FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, ConvertPoint); |
| FRIEND_TEST_ALL_PREFIXES(MultiDisplayManagerTest, TestNativeDisplaysChanged); |
| friend class test::AcceleratorControllerTest; |
| + friend class test::AshTestBase; |
| + friend class MultiDisplayManagerTest; |
| friend class test::SystemGestureEventFilterTest; |
| - typedef std::vector<gfx::Display> Displays; |
| + typedef std::vector<gfx::Display> DisplayList; |
| void Init(); |
| void CycleDisplayImpl(); |
| void ScaleDisplayImpl(); |
| + |
| gfx::Display& FindDisplayForRootWindow(const aura::RootWindow* root); |
| + gfx::Display& FindDisplayForId(int64 id); |
| // Refer to |aura::DisplayManager::CreateDisplayFromSpec| API for |
| // the format of |spec|. |
| void AddDisplayFromSpec(const std::string& spec); |
| - // Enables internal display and returns the display Id for the internal |
| - // display. |
| - int64 EnableInternalDisplayForTest(); |
| + // Set the 1st display as an internal display and returns the display Id for |
| + // the internal display. |
| + int64 SetFirstDisplayAsInternalDisplayForTest(); |
| + |
| + // Update the display's id in the |display_list| to match the ones |
| + // stored in this display manager's |displays_|. This is used to |
| + // emulate display change behavior during the test byn creating the |
| + // display list with the same display ids but with different bounds |
| + void SetDisplayIdsForTest(DisplayList* display_list) const; |
| - Displays displays_; |
| + DisplayList displays_; |
| int64 internal_display_id_; |
| // An internal display cache used when the internal display is disconnectd. |
| scoped_ptr<gfx::Display> internal_display_; |
| + bool force_bounds_changed_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(MultiDisplayManager); |
| }; |