Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: services/ui/view_manager/view_tree_state.cc

Issue 1415493003: mozart: Initial commit of the view manager. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « services/ui/view_manager/view_tree_state.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « services/ui/view_manager/view_tree_state.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698