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

Side by Side Diff: services/ui/view_manager/view_stub.h

Issue 1775143004: Mozart: Directly associate the renderer with the view tree. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-1
Patch Set: Created 4 years, 9 months 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_registry.cc ('k') | services/ui/view_manager/view_tree_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef SERVICES_UI_VIEW_MANAGER_VIEW_STUB_H_ 5 #ifndef SERVICES_UI_VIEW_MANAGER_VIEW_STUB_H_
6 #define SERVICES_UI_VIEW_MANAGER_VIEW_STUB_H_ 6 #define SERVICES_UI_VIEW_MANAGER_VIEW_STUB_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 ViewState* state() const { return state_; } 43 ViewState* state() const { return state_; }
44 44
45 // Returns true if the view which was intended to be referenced by the 45 // Returns true if the view which was intended to be referenced by the
46 // stub has become unavailable. 46 // stub has become unavailable.
47 bool is_unavailable() const { return unavailable_; } 47 bool is_unavailable() const { return unavailable_; }
48 48
49 // Returns true if awaiting resolution of the view. 49 // Returns true if awaiting resolution of the view.
50 bool is_pending() const { return !state_ && !unavailable_; } 50 bool is_pending() const { return !state_ && !unavailable_; }
51 51
52 // Returns true if the view is linked into a tree or parent. 52 // Returns true if the view is linked into a tree or parent.
53 bool is_linked() const { return tree_ && parent_; } 53 bool is_linked() const { return tree_ || parent_; }
54
55 // Returns true if the view is linked into a tree and has no parent.
56 bool is_root_of_tree() const { return tree_ && !parent_; }
54 57
55 // Gets the view tree to which this view belongs, or null if none. 58 // Gets the view tree to which this view belongs, or null if none.
56 ViewTreeState* tree() const { return tree_; } 59 ViewTreeState* tree() const { return tree_; }
57 60
58 // Gets the parent view state, or null if none. 61 // Gets the parent view state, or null if none.
59 ViewState* parent() const { return parent_; } 62 ViewState* parent() const { return parent_; }
60 63
61 // Gets the key that this child has in its container, or 0 if none. 64 // Gets the key that this child has in its container, or 0 if none.
62 uint32_t key() const { return key_; } 65 uint32_t key() const { return key_; }
63 66
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 ViewTreeState* tree_ = nullptr; 105 ViewTreeState* tree_ = nullptr;
103 ViewState* parent_ = nullptr; 106 ViewState* parent_ = nullptr;
104 uint32_t key_ = 0u; 107 uint32_t key_ = 0u;
105 108
106 DISALLOW_COPY_AND_ASSIGN(ViewStub); 109 DISALLOW_COPY_AND_ASSIGN(ViewStub);
107 }; 110 };
108 111
109 } // namespace view_manager 112 } // namespace view_manager
110 113
111 #endif // SERVICES_UI_VIEW_MANAGER_VIEW_STUB_H_ 114 #endif // SERVICES_UI_VIEW_MANAGER_VIEW_STUB_H_
OLDNEW
« no previous file with comments | « services/ui/view_manager/view_registry.cc ('k') | services/ui/view_manager/view_tree_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698