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

Unified Diff: athena/wm/window_manager_impl.cc

Issue 394043002: athena: Add a minimized state for the home-card. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge Created 6 years, 5 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 | « athena/wm/public/window_manager_observer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/wm/window_manager_impl.cc
diff --git a/athena/wm/window_manager_impl.cc b/athena/wm/window_manager_impl.cc
index 8f43a5e162b2f11afa8d5af7b368b49a90785f2d..736d638067c9175c4efb8eb5b1ddd538854ea226 100644
--- a/athena/wm/window_manager_impl.cc
+++ b/athena/wm/window_manager_impl.cc
@@ -6,8 +6,10 @@
#include "athena/input/public/accelerator_manager.h"
#include "athena/screen/public/screen_manager.h"
+#include "athena/wm/public/window_manager_observer.h"
#include "athena/wm/window_overview_mode.h"
#include "base/logging.h"
+#include "base/observer_list.h"
#include "ui/aura/layout_manager.h"
#include "ui/aura/window.h"
#include "ui/wm/public/window_types.h"
@@ -27,10 +29,15 @@ class WindowManagerImpl : public WindowManager,
// WindowManager:
virtual void ToggleOverview() OVERRIDE {
- if (overview_)
+ if (overview_) {
overview_.reset();
- else
+ FOR_EACH_OBSERVER(WindowManagerObserver, observers_,
+ OnOverviewModeExit());
+ } else {
overview_ = WindowOverviewMode::Create(container_.get(), this);
+ FOR_EACH_OBSERVER(WindowManagerObserver, observers_,
+ OnOverviewModeEnter());
+ }
}
private:
@@ -47,11 +54,22 @@ class WindowManagerImpl : public WindowManager,
accelerator_data, arraysize(accelerator_data), this);
}
+ // WindowManager:
+ virtual void AddObserver(WindowManagerObserver* observer) OVERRIDE {
+ observers_.AddObserver(observer);
+ }
+
+ virtual void RemoveObserver(WindowManagerObserver* observer) OVERRIDE {
+ observers_.RemoveObserver(observer);
+ }
+
// WindowOverviewModeDelegate:
virtual void OnSelectWindow(aura::Window* window) OVERRIDE {
CHECK_EQ(container_.get(), window->parent());
container_->StackChildAtTop(window);
overview_.reset();
+ FOR_EACH_OBSERVER(WindowManagerObserver, observers_,
+ OnOverviewModeExit());
}
// aura::WindowObserver
@@ -74,6 +92,7 @@ class WindowManagerImpl : public WindowManager,
scoped_ptr<aura::Window> container_;
scoped_ptr<WindowOverviewMode> overview_;
+ ObserverList<WindowManagerObserver> observers_;
DISALLOW_COPY_AND_ASSIGN(WindowManagerImpl);
};
@@ -155,4 +174,10 @@ void WindowManager::Shutdown() {
DCHECK(!instance);
}
+// static
+WindowManager* WindowManager::GetInstance() {
+ DCHECK(instance);
+ return instance;
+}
+
} // namespace athena
« no previous file with comments | « athena/wm/public/window_manager_observer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698