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

Unified Diff: ash/wm/aura/wm_globals_aura.cc

Issue 1943603002: Makes ash/wm/common a library (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge again Created 4 years, 7 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/wm/aura/wm_globals_aura.h ('k') | ash/wm/aura/wm_lookup_aura.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/aura/wm_globals_aura.cc
diff --git a/ash/wm/aura/wm_globals_aura.cc b/ash/wm/aura/wm_globals_aura.cc
index fe21613452368817d269796bb2ad27784955e3c8..c9c9d38eab303ca549b02f5006e02ff1991340c8 100644
--- a/ash/wm/aura/wm_globals_aura.cc
+++ b/ash/wm/aura/wm_globals_aura.cc
@@ -22,25 +22,14 @@
namespace ash {
namespace wm {
-namespace {
-
-WmGlobalsAura* instance_ = nullptr;
-
-} // namespace
-
-// static
-WmGlobals* WmGlobals::Get() {
- return instance_;
-}
WmGlobalsAura::WmGlobalsAura() {
- DCHECK(!instance_);
- instance_ = this;
+ WmGlobals::Set(this);
Shell::GetInstance()->AddShellObserver(this);
}
WmGlobalsAura::~WmGlobalsAura() {
- instance_ = nullptr;
+ WmGlobals::Set(nullptr);
if (added_activation_observer_) {
aura::client::GetActivationClient(Shell::GetPrimaryRootWindow())
->RemoveObserver(this);
@@ -51,13 +40,6 @@ WmGlobalsAura::~WmGlobalsAura() {
Shell::GetInstance()->RemoveShellObserver(this);
}
-// static
-WmGlobalsAura* WmGlobalsAura::Get() {
- if (!instance_)
- new WmGlobalsAura;
- return instance_;
-}
-
WmWindow* WmGlobalsAura::GetFocusedWindow() {
return WmWindowAura::Get(
aura::client::GetFocusClient(Shell::GetPrimaryRootWindow())
« no previous file with comments | « ash/wm/aura/wm_globals_aura.h ('k') | ash/wm/aura/wm_lookup_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698