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

Side by Side Diff: components/view_manager/public/cpp/lib/view.cc

Issue 1317713006: Changes around how embed roots are set (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge to trunk Created 5 years, 3 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
OLDNEW
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 "components/view_manager/public/cpp/view.h" 5 #include "components/view_manager/public/cpp/view.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "components/view_manager/public/cpp/lib/view_private.h" 10 #include "components/view_manager/public/cpp/lib/view_private.h"
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 ViewObserver, observers_, 273 ViewObserver, observers_,
274 OnViewSharedPropertyChanged(this, name, old_value_ptr, value)); 274 OnViewSharedPropertyChanged(this, name, old_value_ptr, value));
275 } 275 }
276 276
277 bool View::IsDrawn() const { 277 bool View::IsDrawn() const {
278 if (!visible_) 278 if (!visible_)
279 return false; 279 return false;
280 return parent_ ? parent_->IsDrawn() : drawn_; 280 return parent_ ? parent_->IsDrawn() : drawn_;
281 } 281 }
282 282
283 void View::SetAccessPolicy(uint32_t policy_bitmask) {
284 if (connection_) {
285 static_cast<ViewTreeClientImpl*>(connection_)
286 ->SetAccessPolicy(id_, policy_bitmask);
287 }
288 }
289
283 void View::AddObserver(ViewObserver* observer) { 290 void View::AddObserver(ViewObserver* observer) {
284 observers_.AddObserver(observer); 291 observers_.AddObserver(observer);
285 } 292 }
286 293
287 void View::RemoveObserver(ViewObserver* observer) { 294 void View::RemoveObserver(ViewObserver* observer) {
288 observers_.RemoveObserver(observer); 295 observers_.RemoveObserver(observer);
289 } 296 }
290 297
291 const View* View::GetRoot() const { 298 const View* View::GetRoot() const {
292 const View* root = this; 299 const View* root = this;
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 !static_cast<ViewTreeClientImpl*>(connection_)->is_embed_root()) { 615 !static_cast<ViewTreeClientImpl*>(connection_)->is_embed_root()) {
609 return false; 616 return false;
610 } 617 }
611 618
612 while (!children_.empty()) 619 while (!children_.empty())
613 RemoveChild(children_[0]); 620 RemoveChild(children_[0]);
614 return true; 621 return true;
615 } 622 }
616 623
617 } // namespace mojo 624 } // namespace mojo
OLDNEW
« no previous file with comments | « components/view_manager/default_access_policy.cc ('k') | components/view_manager/public/cpp/lib/view_tree_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698