OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "mojo/public/cpp/application/application_connection.h" | 9 #include "mojo/public/cpp/application/application_connection.h" |
10 #include "mojo/public/cpp/application/application_delegate.h" | 10 #include "mojo/public/cpp/application/application_delegate.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 navigation::NavigationDetails::New()); | 106 navigation::NavigationDetails::New()); |
107 nav_details->url = "http://www.aaronboodman.com/z_dropbox/test.html"; | 107 nav_details->url = "http://www.aaronboodman.com/z_dropbox/test.html"; |
108 navigator_host_->RequestNavigate(view->node()->id(), | 108 navigator_host_->RequestNavigate(view->node()->id(), |
109 navigation::SOURCE_NODE, | 109 navigation::SOURCE_NODE, |
110 nav_details.Pass()); | 110 nav_details.Pass()); |
111 } | 111 } |
112 } | 112 } |
113 } | 113 } |
114 | 114 |
115 // Overridden from NodeObserver: | 115 // Overridden from NodeObserver: |
116 virtual void OnNodeActiveViewChange( | 116 virtual void OnNodeActiveViewChanged(Node* node, |
117 Node* node, | 117 View* old_view, |
118 View* old_view, | 118 View* new_view) OVERRIDE { |
119 View* new_view, | |
120 NodeObserver::DispositionChangePhase phase) OVERRIDE { | |
121 if (new_view == 0) | 119 if (new_view == 0) |
122 views_to_reap_[node] = old_view; | 120 views_to_reap_[node] = old_view; |
123 } | 121 } |
124 virtual void OnNodeDestroy( | 122 virtual void OnNodeDestroyed(Node* node) OVERRIDE { |
125 Node* node, | |
126 NodeObserver::DispositionChangePhase phase) OVERRIDE { | |
127 if (phase != NodeObserver::DISPOSITION_CHANGED) | |
128 return; | |
129 DCHECK(roots_.find(node->id()) != roots_.end()); | 123 DCHECK(roots_.find(node->id()) != roots_.end()); |
130 roots_.erase(node->id()); | 124 roots_.erase(node->id()); |
131 std::map<Node*, View*>::const_iterator it = views_to_reap_.find(node); | 125 std::map<Node*, View*>::const_iterator it = views_to_reap_.find(node); |
132 if (it != views_to_reap_.end()) | 126 if (it != views_to_reap_.end()) |
133 it->second->Destroy(); | 127 it->second->Destroy(); |
134 } | 128 } |
135 | 129 |
136 void ProcessPendingNodeColor(uint32 node_id) { | 130 void ProcessPendingNodeColor(uint32 node_id) { |
137 RootMap::iterator root = roots_.find(node_id); | 131 RootMap::iterator root = roots_.find(node_id); |
138 if (root == roots_.end()) | 132 if (root == roots_.end()) |
(...skipping 22 matching lines...) Expand all Loading... |
161 }; | 155 }; |
162 | 156 |
163 } // namespace examples | 157 } // namespace examples |
164 | 158 |
165 // static | 159 // static |
166 ApplicationDelegate* ApplicationDelegate::Create() { | 160 ApplicationDelegate* ApplicationDelegate::Create() { |
167 return new examples::EmbeddedApp; | 161 return new examples::EmbeddedApp; |
168 } | 162 } |
169 | 163 |
170 } // namespace mojo | 164 } // namespace mojo |
OLD | NEW |