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

Unified Diff: mojo/examples/embedded_app/embedded_app.cc

Issue 341553002: Remove OnRootRemoved from ViewManagerDelegate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 6 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 | « mojo/examples/browser/browser.cc ('k') | mojo/examples/nesting_app/nesting_app.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/examples/embedded_app/embedded_app.cc
diff --git a/mojo/examples/embedded_app/embedded_app.cc b/mojo/examples/embedded_app/embedded_app.cc
index 1a620b408b57f8a17804174df1fcfc20723ce62d..3aa81d33e27426ca0f133d2f87dc839f81f98bfa 100644
--- a/mojo/examples/embedded_app/embedded_app.cc
+++ b/mojo/examples/embedded_app/embedded_app.cc
@@ -88,13 +88,6 @@ class EmbeddedApp : public Application,
roots_[root->id()] = root;
ProcessPendingNodeColor(root->id());
}
- virtual void OnRootRemoved(ViewManager* view_manager, Node* root) OVERRIDE {
- roots_.erase(root->id());
-
- std::map<Node*, View*>::const_iterator it = views_to_reap_.find(root);
- if (it != views_to_reap_.end())
- it->second->Destroy();
- }
// Overridden from ViewObserver:
virtual void OnViewInputEvent(View* view, const EventPtr& event) OVERRIDE {
@@ -111,6 +104,17 @@ class EmbeddedApp : public Application,
if (new_view == 0)
views_to_reap_[node] = old_view;
}
+ virtual void OnNodeDestroy(
+ Node* node,
+ NodeObserver::DispositionChangePhase phase) OVERRIDE {
+ if (phase != NodeObserver::DISPOSITION_CHANGED)
+ return;
+ DCHECK(roots_.find(node->id()) != roots_.end());
+ roots_.erase(node->id());
+ std::map<Node*, View*>::const_iterator it = views_to_reap_.find(node);
+ if (it != views_to_reap_.end())
+ it->second->Destroy();
+ }
void ProcessPendingNodeColor(uint32 node_id) {
RootMap::iterator root = roots_.find(node_id);
@@ -125,12 +129,11 @@ class EmbeddedApp : public Application,
pending_node_colors_.erase(color);
}
-
view_manager::ViewManager* view_manager_;
IWindowManagerPtr window_manager_;
std::map<Node*, View*> views_to_reap_;
- typedef std::map<uint32, Node*> RootMap;
+ typedef std::map<view_manager::Id, Node*> RootMap;
RootMap roots_;
// We can receive navigations for nodes we don't have yet.
« no previous file with comments | « mojo/examples/browser/browser.cc ('k') | mojo/examples/nesting_app/nesting_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698