| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/logging.h" |
| 6 #include "services/ui/view_manager/view_tree_state.h" |
| 7 |
| 8 namespace view_manager { |
| 9 |
| 10 ViewTreeState::ViewTreeState(mojo::ui::ViewTreePtr view_tree) |
| 11 : view_tree_(view_tree.Pass()), |
| 12 root_(nullptr), |
| 13 explicit_root_(false), |
| 14 layout_request_pending_(false), |
| 15 layout_request_issued_(false), |
| 16 weak_factory_(this) { |
| 17 DCHECK(view_tree_); |
| 18 } |
| 19 |
| 20 ViewTreeState::~ViewTreeState() {} |
| 21 |
| 22 void ViewTreeState::SetRoot(ViewState* root, uint32_t key) { |
| 23 DCHECK(root); |
| 24 if (root_ != root) { |
| 25 ResetRoot(); |
| 26 root->SetTree(this, key); |
| 27 root_ = root; |
| 28 } |
| 29 } |
| 30 |
| 31 void ViewTreeState::ResetRoot() { |
| 32 if (root_) { |
| 33 root_->ResetContainer(); |
| 34 } |
| 35 root_ = nullptr; |
| 36 } |
| 37 |
| 38 } // namespace view_manager |
| OLD | NEW |