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

Unified Diff: athena/wm/window_manager_impl.cc

Issue 287253003: Add initial home card impl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« athena/main/placeholder.cc ('K') | « athena/screen/screen_manager_impl.cc ('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 39a1d75d236110e024529d3b8b298824007361a4..8539fe7bc326bb4074a4f2d71a0c696b5eb5934c 100644
--- a/athena/wm/window_manager_impl.cc
+++ b/athena/wm/window_manager_impl.cc
@@ -12,7 +12,8 @@
namespace athena {
namespace {
-class WindowManagerImpl : public WindowManager {
+class WindowManagerImpl : public WindowManager,
+ public aura::WindowObserver {
public:
WindowManagerImpl();
virtual ~WindowManagerImpl();
@@ -20,6 +21,12 @@ class WindowManagerImpl : public WindowManager {
void Layout();
private:
+ // aura::WindowObserver
+ virtual void OnWindowDestroying(aura::Window* window) OVERRIDE {
+ if (window == container_)
+ container_ = NULL;
+ }
+
aura::Window* container_;
DISALLOW_COPY_AND_ASSIGN(WindowManagerImpl);
@@ -40,7 +47,9 @@ class AthenaContainerLayoutManager : public aura::LayoutManager {
}
virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE {}
virtual void OnWindowRemovedFromLayout(aura::Window* child) OVERRIDE {
- instance->Layout();
+ // TODO(oshima): Delete root window after athena is cleaned up.
Albert Bodenhamer 2014/05/22 19:22:02 File a bug to track the TODO so it doesn't get los
oshima 2014/05/22 21:23:05 The comment wasn't correct. If fixed the root caus
+ if (instance)
+ instance->Layout();
}
virtual void OnChildWindowVisibilityChanged(aura::Window* child,
bool visible) OVERRIDE {
@@ -56,16 +65,22 @@ class AthenaContainerLayoutManager : public aura::LayoutManager {
};
WindowManagerImpl::WindowManagerImpl()
- : container_(ScreenManager::Get()->GetContainerWindow()) {
+ : container_(
+ ScreenManager::Get()->CreateDefaultContainer("MainConttainer")) {
Mr4D (OOO till 08-26) 2014/05/22 20:53:28 tt -> t
oshima 2014/05/22 21:23:05 Done.
container_->SetLayoutManager(new AthenaContainerLayoutManager);
+ container_->AddObserver(this);
instance = this;
}
WindowManagerImpl::~WindowManagerImpl() {
+ if (container_)
+ container_->RemoveObserver(this);
instance = NULL;
}
void WindowManagerImpl::Layout() {
+ if (!container_)
+ return;
gfx::Rect bounds = gfx::Rect(container_->bounds().size());
// Just make it small a bit so that the background is visible.
bounds.Inset(10, 10, 10, 10);
« athena/main/placeholder.cc ('K') | « athena/screen/screen_manager_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698