Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2981)

Unified Diff: ash/display/multi_display_manager.h

Issue 10905288: Switch primary display (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/display/mouse_cursor_event_filter.cc ('k') | ash/display/multi_display_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..de3fd8012928176d8561a2c8f6c6baae35dc3833 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,13 +46,21 @@ class ASH_EXPORT MultiDisplayManager : public aura::DisplayManager,
static void CycleDisplay();
static void ToggleDisplayScale();
- // Detects the internal display's ID, and stores gfx::Display
- // in the cache, if any.
- void InitInternalDisplayInfo();
+ // When set to true, the MultiMonitorManager calls OnDisplayBoundsChanged
+ // 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;
+ }
+
+ // 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;
+ bool IsInternalDisplayId(int64 id) const;
+
bool UpdateWorkAreaOfDisplayNearestWindow(const aura::Window* window,
const gfx::Insets& insets);
@@ -75,7 +84,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 +94,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);
};
« no previous file with comments | « ash/display/mouse_cursor_event_filter.cc ('k') | ash/display/multi_display_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698