Chromium Code Reviews| Index: ash/display/display_controller.h |
| diff --git a/ash/display/display_controller.h b/ash/display/display_controller.h |
| index ac513cd846efd4dbb474215fc3bf183a6b0e1d1f..0c00cfb3b6463e03001c54cf709124a70393ea00 100644 |
| --- a/ash/display/display_controller.h |
| +++ b/ash/display/display_controller.h |
| @@ -83,6 +83,10 @@ class ASH_EXPORT DisplayController : public aura::DisplayObserver { |
| DisplayController(); |
| virtual ~DisplayController(); |
| + // Gets primary display. This information is stored in global |
| + // object as this can be accessed after Shell is closed. |
| + static const gfx::Display& GetPrimaryDisplay(); |
|
Daniel Erat
2012/09/19 20:47:33
nit: returning a reference to an internal pointer
oshima
2012/09/19 21:21:28
This pattern isn't uncommon in chrome (quick searc
Daniel Erat
2012/09/19 21:31:47
Accessors that return const references are super-c
|
| + |
| // Initializes primary display. |
| void InitPrimaryDisplay(); |
| @@ -99,10 +103,8 @@ 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_; |
| - } |
| + // Sets primary display. This re-assigns the current root |
| + // window to given |display|. |
| void SetPrimaryDisplay(const gfx::Display& display); |
| // Returns the secondary display. |
| @@ -160,8 +162,6 @@ class ASH_EXPORT DisplayController : public aura::DisplayObserver { |
| ObserverList<Observer> observers_; |
| - gfx::Display primary_display_; |
| - |
| DISALLOW_COPY_AND_ASSIGN(DisplayController); |
| }; |