diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-08 04:35:53 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-08 04:35:53 +0000 |
commit | 8a810d9876bff1cee4f67b48efb406a8fafdd21a (patch) | |
tree | 7410abd5ae093ff4c620944cba2042ddc57ec3c8 /ui | |
parent | 197eeace847bb687765593d6b2d33705e1144672 (diff) | |
download | chromium_src-8a810d9876bff1cee4f67b48efb406a8fafdd21a.zip chromium_src-8a810d9876bff1cee4f67b48efb406a8fafdd21a.tar.gz chromium_src-8a810d9876bff1cee4f67b48efb406a8fafdd21a.tar.bz2 |
Renames LayoutManager::OnWindowAdded/OnWillRemoveWindow to
OnWindowAddedToLayout and OnWillRemoveWindowFromLayout. I'm doing this
so that if you extend both LayoutManager and WindowObserver it's
easier to distinguish where the method is originating from.
This fixes a crash as ToplevelLayoutManager didn't want to implement
the WIndowObserver variants but ended up implementing them by virtue
of both having the same name.
BUG=none
TEST=none
R=ben@chromium.org
Review URL: http://codereview.chromium.org/8479051
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108978 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/aura/layout_manager.h | 4 | ||||
-rw-r--r-- | ui/aura/window.cc | 4 | ||||
-rw-r--r-- | ui/aura_shell/default_container_layout_manager.cc | 5 | ||||
-rw-r--r-- | ui/aura_shell/default_container_layout_manager.h | 4 | ||||
-rw-r--r-- | ui/aura_shell/desktop_layout_manager.cc | 4 | ||||
-rw-r--r-- | ui/aura_shell/desktop_layout_manager.h | 4 | ||||
-rw-r--r-- | ui/aura_shell/toplevel_layout_manager.cc | 5 | ||||
-rw-r--r-- | ui/aura_shell/toplevel_layout_manager.h | 4 |
8 files changed, 18 insertions, 16 deletions
diff --git a/ui/aura/layout_manager.h b/ui/aura/layout_manager.h index a5f53b4..2d981a0 100644 --- a/ui/aura/layout_manager.h +++ b/ui/aura/layout_manager.h @@ -26,10 +26,10 @@ class AURA_EXPORT LayoutManager { virtual void OnWindowResized() = 0; // Invoked when the window |child| has been added. - virtual void OnWindowAdded(Window* child) = 0; + virtual void OnWindowAddedToLayout(Window* child) = 0; // Invoked prior to removing |window|. - virtual void OnWillRemoveWindow(Window* child) = 0; + virtual void OnWillRemoveWindowFromLayout(Window* child) = 0; // Invoked when the |SetVisible()| is invoked on the window |child|. // |visible| is the value supplied to |SetVisible()|. If |visible| is true, diff --git a/ui/aura/window.cc b/ui/aura/window.cc index 17f1b50..f5bfda9 100644 --- a/ui/aura/window.cc +++ b/ui/aura/window.cc @@ -207,7 +207,7 @@ void Window::AddChild(Window* child) { layer_->Add(child->layer_.get()); children_.push_back(child); if (layout_manager_.get()) - layout_manager_->OnWindowAdded(child); + layout_manager_->OnWindowAddedToLayout(child); FOR_EACH_OBSERVER(WindowObserver, observers_, OnWindowAdded(child)); } @@ -233,7 +233,7 @@ void Window::RemoveChild(Window* child) { Windows::iterator i = std::find(children_.begin(), children_.end(), child); DCHECK(i != children_.end()); if (layout_manager_.get()) - layout_manager_->OnWillRemoveWindow(child); + layout_manager_->OnWillRemoveWindowFromLayout(child); FOR_EACH_OBSERVER(WindowObserver, observers_, OnWillRemoveWindow(child)); child->parent_ = NULL; layer_->Remove(child->layer_.get()); diff --git a/ui/aura_shell/default_container_layout_manager.cc b/ui/aura_shell/default_container_layout_manager.cc index d44eec5..43f280d 100644 --- a/ui/aura_shell/default_container_layout_manager.cc +++ b/ui/aura_shell/default_container_layout_manager.cc @@ -96,7 +96,7 @@ void DefaultContainerLayoutManager::OnWindowResized() { // Workspace is updated via DesktopObserver::OnDesktopResized. } -void DefaultContainerLayoutManager::OnWindowAdded(aura::Window* child) { +void DefaultContainerLayoutManager::OnWindowAddedToLayout(aura::Window* child) { if (child->type() != aura::WINDOW_TYPE_NORMAL || child->transient_parent()) return; @@ -120,7 +120,8 @@ void DefaultContainerLayoutManager::OnWindowAdded(aura::Window* child) { new_workspace->Activate(); } -void DefaultContainerLayoutManager::OnWillRemoveWindow(aura::Window* child) { +void DefaultContainerLayoutManager::OnWillRemoveWindowFromLayout( + aura::Window* child) { child->RemoveObserver(show_state_controller_.get()); ClearRestoreBounds(child); diff --git a/ui/aura_shell/default_container_layout_manager.h b/ui/aura_shell/default_container_layout_manager.h index 50336c3..24bc604 100644 --- a/ui/aura_shell/default_container_layout_manager.h +++ b/ui/aura_shell/default_container_layout_manager.h @@ -56,8 +56,8 @@ class AURA_SHELL_EXPORT DefaultContainerLayoutManager // Overridden from aura::LayoutManager: virtual void OnWindowResized() OVERRIDE; - virtual void OnWindowAdded(aura::Window* child) OVERRIDE; - virtual void OnWillRemoveWindow(aura::Window* child) OVERRIDE; + virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE; + virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE; virtual void OnChildWindowVisibilityChanged(aura::Window* child, bool visibile) OVERRIDE; virtual void SetChildBounds(aura::Window* child, diff --git a/ui/aura_shell/desktop_layout_manager.cc b/ui/aura_shell/desktop_layout_manager.cc index fbcdb17..4160a43 100644 --- a/ui/aura_shell/desktop_layout_manager.cc +++ b/ui/aura_shell/desktop_layout_manager.cc @@ -40,10 +40,10 @@ void DesktopLayoutManager::OnWindowResized() { shelf_->LayoutShelf(); } -void DesktopLayoutManager::OnWindowAdded(aura::Window* child) { +void DesktopLayoutManager::OnWindowAddedToLayout(aura::Window* child) { } -void DesktopLayoutManager::OnWillRemoveWindow(aura::Window* child) { +void DesktopLayoutManager::OnWillRemoveWindowFromLayout(aura::Window* child) { } void DesktopLayoutManager::OnChildWindowVisibilityChanged(aura::Window* child, diff --git a/ui/aura_shell/desktop_layout_manager.h b/ui/aura_shell/desktop_layout_manager.h index 08bc16c..96abeeb 100644 --- a/ui/aura_shell/desktop_layout_manager.h +++ b/ui/aura_shell/desktop_layout_manager.h @@ -40,8 +40,8 @@ class DesktopLayoutManager : public aura::LayoutManager { // Overridden from aura::LayoutManager: virtual void OnWindowResized() OVERRIDE; - virtual void OnWindowAdded(aura::Window* child) OVERRIDE; - virtual void OnWillRemoveWindow(aura::Window* child) OVERRIDE; + virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE; + virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE; virtual void OnChildWindowVisibilityChanged(aura::Window* child, bool visibile) OVERRIDE; virtual void SetChildBounds(aura::Window* child, diff --git a/ui/aura_shell/toplevel_layout_manager.cc b/ui/aura_shell/toplevel_layout_manager.cc index 6846547..65ff83e 100644 --- a/ui/aura_shell/toplevel_layout_manager.cc +++ b/ui/aura_shell/toplevel_layout_manager.cc @@ -27,14 +27,15 @@ ToplevelLayoutManager::~ToplevelLayoutManager() { void ToplevelLayoutManager::OnWindowResized() { } -void ToplevelLayoutManager::OnWindowAdded(aura::Window* child) { +void ToplevelLayoutManager::OnWindowAddedToLayout(aura::Window* child) { windows_.insert(child); child->AddObserver(this); if (child->GetProperty(aura::kShowStateKey)) WindowStateChanged(child); } -void ToplevelLayoutManager::OnWillRemoveWindow(aura::Window* child) { +void ToplevelLayoutManager::OnWillRemoveWindowFromLayout( + aura::Window* child) { windows_.erase(child); child->RemoveObserver(this); UpdateShelfVisibility(); diff --git a/ui/aura_shell/toplevel_layout_manager.h b/ui/aura_shell/toplevel_layout_manager.h index 5c080aa..0593e8d 100644 --- a/ui/aura_shell/toplevel_layout_manager.h +++ b/ui/aura_shell/toplevel_layout_manager.h @@ -33,8 +33,8 @@ class AURA_SHELL_EXPORT ToplevelLayoutManager : public aura::LayoutManager, // LayoutManager overrides: virtual void OnWindowResized() OVERRIDE; - virtual void OnWindowAdded(aura::Window* child) OVERRIDE; - virtual void OnWillRemoveWindow(aura::Window* child) OVERRIDE; + virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE; + virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE; virtual void OnChildWindowVisibilityChanged(aura::Window* child, bool visibile) OVERRIDE; virtual void SetChildBounds(aura::Window* child, |