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

Unified Diff: ash/display/display_controller.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/accelerators/accelerator_table.cc ('k') | ash/display/display_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_controller.h
diff --git a/ash/display/display_controller.h b/ash/display/display_controller.h
index 218ab21c99bf3fba1e8264e10991ac14a522d561..ac513cd846efd4dbb474215fc3bf183a6b0e1d1f 100644
--- a/ash/display/display_controller.h
+++ b/ash/display/display_controller.h
@@ -15,6 +15,7 @@
#include "base/observer_list.h"
#include "ui/aura/display_observer.h"
#include "ui/aura/display_manager.h"
+#include "ui/gfx/display.h"
namespace aura {
class Display;
@@ -43,6 +44,9 @@ struct ASH_EXPORT DisplayLayout {
DisplayLayout();
DisplayLayout(Position position, int offset);
+ // Returns an inverted display layout.
+ DisplayLayout Invert() const WARN_UNUSED_RESULT;
+
// Converter functions to/from base::Value.
static bool ConvertFromValue(const base::Value& value, DisplayLayout* layout);
static bool ConvertToValue(const DisplayLayout& layout, base::Value* value);
@@ -57,6 +61,9 @@ struct ASH_EXPORT DisplayLayout {
// The offset of the position of the secondary display. The offset is
// based on the top/left edge of the primary display.
int offset;
+
+ // Returns string representation of the layout for debugging/testing.
+ std::string ToString() const;
};
// DisplayController owns and maintains RootWindows for each attached
@@ -92,6 +99,15 @@ class ASH_EXPORT DisplayController : public aura::DisplayObserver {
// Returns the root window for |display_id|.
aura::RootWindow* GetRootWindowForDisplayId(int64 id);
+ // Sets/Gets primary display.
+ const gfx::Display& primary_display() const {
+ return primary_display_;
+ }
+ void SetPrimaryDisplay(const gfx::Display& display);
+
+ // Returns the secondary display.
+ gfx::Display* GetSecondaryDisplay();
+
// Closes all child windows in the all root windows.
void CloseChildWindows();
@@ -108,11 +124,15 @@ class ASH_EXPORT DisplayController : public aura::DisplayObserver {
}
void SetDefaultDisplayLayout(const DisplayLayout& layout);
- // Sets/gets the display layout for the specified display name. Getter
- // returns the default value in case it doesn't have its own layout yet.
+ // Sets/gets the display layout for the specified display or display
+ // name. Getter returns the default value in case it doesn't have
+ // its own layout yet.
void SetLayoutForDisplayName(const std::string& name,
const DisplayLayout& layout);
- const DisplayLayout& GetLayoutForDisplayName(const std::string& name);
+ const DisplayLayout& GetLayoutForDisplay(const gfx::Display& display) const;
+
+ // Returns the display layout used for current secondary display.
+ const DisplayLayout& GetCurrentDisplayLayout() const;
// aura::DisplayObserver overrides:
virtual void OnDisplayBoundsChanged(
@@ -140,6 +160,8 @@ class ASH_EXPORT DisplayController : public aura::DisplayObserver {
ObserverList<Observer> observers_;
+ gfx::Display primary_display_;
+
DISALLOW_COPY_AND_ASSIGN(DisplayController);
};
« no previous file with comments | « ash/accelerators/accelerator_table.cc ('k') | ash/display/display_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698