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

Unified Diff: mojo/services/view_manager/server_view.cc

Issue 557573002: Changes view manager to report visibility and drawn state (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge 2 trunk Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/services/view_manager/server_view.h ('k') | mojo/services/view_manager/server_view_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/view_manager/server_view.cc
diff --git a/mojo/services/view_manager/server_view.cc b/mojo/services/view_manager/server_view.cc
index 33507c25882e52f75737e37ff3315334437254f4..c6494d2400aaff89253cb8196122e7b41cdc5064 100644
--- a/mojo/services/view_manager/server_view.cc
+++ b/mojo/services/view_manager/server_view.cc
@@ -37,6 +37,7 @@ void ServerView::Add(ServerView* child) {
}
const ServerView* old_parent = child->parent();
+ child->delegate_->OnWillChangeViewHierarchy(child, this, old_parent);
if (child->parent())
child->parent()->RemoveImpl(child);
@@ -51,6 +52,7 @@ void ServerView::Remove(ServerView* child) {
DCHECK(child != this);
DCHECK(child->parent() == this);
+ child->delegate_->OnWillChangeViewHierarchy(child, NULL, this);
RemoveImpl(child);
child->delegate_->OnViewHierarchyChanged(child, NULL, this);
}
@@ -114,8 +116,17 @@ void ServerView::SetVisible(bool value) {
if (visible_ == value)
return;
+ delegate_->OnWillChangeViewVisibility(this);
visible_ = value;
- // TODO(sky): notification, including repaint.
+}
+
+bool ServerView::IsDrawn(const ServerView* root) const {
+ if (!root->visible_)
+ return false;
+ const ServerView* view = this;
+ while (view && view != root && view->visible_)
+ view = view->parent_;
+ return view == root;
}
void ServerView::SetBitmap(const SkBitmap& bitmap) {
« no previous file with comments | « mojo/services/view_manager/server_view.h ('k') | mojo/services/view_manager/server_view_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698