Chromium Code Reviews| 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; |
|
oshima
2012/09/18 09:30:48
I noticed that I was mistakenly using default_layo
|
| // 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); |
| }; |