| 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_synchronizer.h" | 7 #include "mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.h" |
| 8 #include "mojo/services/public/cpp/view_manager/lib/view_private.h" | 8 #include "mojo/services/public/cpp/view_manager/lib/view_private.h" |
| 9 #include "mojo/services/public/cpp/view_manager/lib/view_tree_node_private.h" | 9 #include "mojo/services/public/cpp/view_manager/lib/view_tree_node_private.h" |
| 10 #include "mojo/services/public/cpp/view_manager/view.h" | 10 #include "mojo/services/public/cpp/view_manager/view.h" |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 // embeddee in an embedder-embeddee relationship. | 350 // embeddee in an embedder-embeddee relationship. |
| 351 if (manager_) | 351 if (manager_) |
| 352 CHECK_EQ(ViewPrivate(view).view_manager(), manager_); | 352 CHECK_EQ(ViewPrivate(view).view_manager(), manager_); |
| 353 LocalSetActiveView(view); | 353 LocalSetActiveView(view); |
| 354 if (manager_) { | 354 if (manager_) { |
| 355 static_cast<ViewManagerSynchronizer*>(manager_)->SetActiveView( | 355 static_cast<ViewManagerSynchronizer*>(manager_)->SetActiveView( |
| 356 id_, active_view_->id()); | 356 id_, active_view_->id()); |
| 357 } | 357 } |
| 358 } | 358 } |
| 359 | 359 |
| 360 void ViewTreeNode::SetFocus() { |
| 361 if (manager_) |
| 362 static_cast<ViewManagerSynchronizer*>(manager_)->SetFocus(id_); |
| 363 } |
| 364 |
| 360 void ViewTreeNode::Embed(const String& url) { | 365 void ViewTreeNode::Embed(const String& url) { |
| 361 static_cast<ViewManagerSynchronizer*>(manager_)->Embed(url, id_); | 366 static_cast<ViewManagerSynchronizer*>(manager_)->Embed(url, id_); |
| 362 } | 367 } |
| 363 | 368 |
| 364 //////////////////////////////////////////////////////////////////////////////// | 369 //////////////////////////////////////////////////////////////////////////////// |
| 365 // ViewTreeNode, protected: | 370 // ViewTreeNode, protected: |
| 366 | 371 |
| 367 ViewTreeNode::ViewTreeNode() | 372 ViewTreeNode::ViewTreeNode() |
| 368 : manager_(NULL), | 373 : manager_(NULL), |
| 369 id_(-1), | 374 id_(-1), |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 void ViewTreeNode::LocalSetBounds(const gfx::Rect& old_bounds, | 430 void ViewTreeNode::LocalSetBounds(const gfx::Rect& old_bounds, |
| 426 const gfx::Rect& new_bounds) { | 431 const gfx::Rect& new_bounds) { |
| 427 DCHECK(old_bounds == bounds_); | 432 DCHECK(old_bounds == bounds_); |
| 428 ScopedSetBoundsNotifier notifier(this, old_bounds, new_bounds); | 433 ScopedSetBoundsNotifier notifier(this, old_bounds, new_bounds); |
| 429 bounds_ = new_bounds; | 434 bounds_ = new_bounds; |
| 430 } | 435 } |
| 431 | 436 |
| 432 } // namespace view_manager | 437 } // namespace view_manager |
| 433 } // namespace mojo | 438 } // namespace mojo |
| 434 | 439 |
| OLD | NEW |