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

Unified Diff: ash/display/display_controller.h

Issue 10952028: Fix crashers in GetPrimaryDisplay (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
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);
};
« no previous file with comments | « no previous file | ash/display/display_controller.cc » ('j') | chrome/browser/lifetime/application_lifetime_aura.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698