OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |