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/node.h" | 5 #include "mojo/services/public/cpp/view_manager/node.h" |
6 | 6 |
7 #include "mojo/services/public/cpp/view_manager/lib/node_private.h" | 7 #include "mojo/services/public/cpp/view_manager/lib/node_private.h" |
8 #include "mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h" | 8 #include "mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.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/node_observer.h" | 10 #include "mojo/services/public/cpp/view_manager/node_observer.h" |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 | 347 |
348 void Node::Embed(const String& url) { | 348 void Node::Embed(const String& url) { |
349 static_cast<ViewManagerClientImpl*>(manager_)->Embed(url, id_); | 349 static_cast<ViewManagerClientImpl*>(manager_)->Embed(url, id_); |
350 } | 350 } |
351 | 351 |
352 //////////////////////////////////////////////////////////////////////////////// | 352 //////////////////////////////////////////////////////////////////////////////// |
353 // Node, protected: | 353 // Node, protected: |
354 | 354 |
355 Node::Node() | 355 Node::Node() |
356 : manager_(NULL), | 356 : manager_(NULL), |
357 id_(-1), | 357 id_(static_cast<Id>(-1)), |
358 parent_(NULL), | 358 parent_(NULL), |
359 active_view_(NULL) {} | 359 active_view_(NULL) {} |
360 | 360 |
361 Node::~Node() { | 361 Node::~Node() { |
362 ScopedDestructionNotifier notifier(this); | 362 ScopedDestructionNotifier notifier(this); |
363 if (parent_) | 363 if (parent_) |
364 parent_->LocalRemoveChild(this); | 364 parent_->LocalRemoveChild(this); |
365 // TODO(beng): It'd be better to do this via a destruction observer in the | 365 // TODO(beng): It'd be better to do this via a destruction observer in the |
366 // ViewManagerClientImpl. | 366 // ViewManagerClientImpl. |
367 if (manager_) | 367 if (manager_) |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 | 410 |
411 void Node::LocalSetBounds(const gfx::Rect& old_bounds, | 411 void Node::LocalSetBounds(const gfx::Rect& old_bounds, |
412 const gfx::Rect& new_bounds) { | 412 const gfx::Rect& new_bounds) { |
413 DCHECK(old_bounds == bounds_); | 413 DCHECK(old_bounds == bounds_); |
414 ScopedSetBoundsNotifier notifier(this, old_bounds, new_bounds); | 414 ScopedSetBoundsNotifier notifier(this, old_bounds, new_bounds); |
415 bounds_ = new_bounds; | 415 bounds_ = new_bounds; |
416 } | 416 } |
417 | 417 |
418 } // namespace view_manager | 418 } // namespace view_manager |
419 } // namespace mojo | 419 } // namespace mojo |
OLD | NEW |