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 "mojo/services/public/cpp/view_manager/view_tree_node.h" | 5 #include "mojo/services/public/cpp/view_manager/view_tree_node.h" |
6 | 6 |
7 #include "mojo/services/public/cpp/view_manager/lib/view_manager_private.h" | 7 #include "mojo/services/public/cpp/view_manager/lib/view_manager_private.h" |
8 #include "mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.h" | 8 #include "mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.h" |
9 #include "mojo/services/public/cpp/view_manager/lib/view_private.h" | 9 #include "mojo/services/public/cpp/view_manager/lib/view_private.h" |
10 #include "mojo/services/public/cpp/view_manager/lib/view_tree_node_private.h" | 10 #include "mojo/services/public/cpp/view_manager/lib/view_tree_node_private.h" |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 // embeddee in an embedder-embeddee relationship. | 265 // embeddee in an embedder-embeddee relationship. |
266 if (manager_) | 266 if (manager_) |
267 CHECK_EQ(ViewPrivate(view).view_manager(), manager_); | 267 CHECK_EQ(ViewPrivate(view).view_manager(), manager_); |
268 LocalSetActiveView(view); | 268 LocalSetActiveView(view); |
269 if (manager_) { | 269 if (manager_) { |
270 ViewManagerPrivate(manager_).synchronizer()->SetActiveView( | 270 ViewManagerPrivate(manager_).synchronizer()->SetActiveView( |
271 id_, active_view_->id()); | 271 id_, active_view_->id()); |
272 } | 272 } |
273 } | 273 } |
274 | 274 |
| 275 void ViewTreeNode::Embed(const String& url) { |
| 276 ViewManagerPrivate(manager_).synchronizer()->Embed(url, id_); |
| 277 } |
| 278 |
275 //////////////////////////////////////////////////////////////////////////////// | 279 //////////////////////////////////////////////////////////////////////////////// |
276 // ViewTreeNode, protected: | 280 // ViewTreeNode, protected: |
277 | 281 |
278 ViewTreeNode::ViewTreeNode() | 282 ViewTreeNode::ViewTreeNode() |
279 : manager_(NULL), | 283 : manager_(NULL), |
280 id_(-1), | 284 id_(-1), |
281 parent_(NULL), | 285 parent_(NULL), |
282 active_view_(NULL) {} | 286 active_view_(NULL) {} |
283 | 287 |
284 ViewTreeNode::~ViewTreeNode() { | 288 ViewTreeNode::~ViewTreeNode() { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 void ViewTreeNode::LocalSetBounds(const gfx::Rect& old_bounds, | 332 void ViewTreeNode::LocalSetBounds(const gfx::Rect& old_bounds, |
329 const gfx::Rect& new_bounds) { | 333 const gfx::Rect& new_bounds) { |
330 DCHECK(old_bounds == bounds_); | 334 DCHECK(old_bounds == bounds_); |
331 ScopedSetBoundsNotifier notifier(this, old_bounds, new_bounds); | 335 ScopedSetBoundsNotifier notifier(this, old_bounds, new_bounds); |
332 bounds_ = new_bounds; | 336 bounds_ = new_bounds; |
333 } | 337 } |
334 | 338 |
335 } // namespace view_manager | 339 } // namespace view_manager |
336 } // namespace mojo | 340 } // namespace mojo |
337 | 341 |
OLD | NEW |