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

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: applied review comments 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
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 : root_was_set(false),
12 layout_request_pending(false),
13 layout_request_issued(false),
14 view_tree_(view_tree.Pass()),
15 root_(nullptr) {
16 DCHECK(view_tree_);
17 }
18
19 ViewTreeState::~ViewTreeState() {}
20
21 void ViewTreeState::SetRoot(ViewState* root, uint32_t key) {
22 DCHECK(root);
23 if (root_ != root) {
24 ResetRoot();
25 root->SetTree(this, key);
26 root_ = root;
27 }
28 }
29
30 void ViewTreeState::ResetRoot() {
31 if (root_) {
32 root_->ResetContainer();
33 }
34 root_ = nullptr;
35 }
36
37 } // namespace view_manager
OLDNEW
« services/ui/view_manager/view_tree_state.h ('K') | « 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