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

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

Issue 720883003: Adds a CloneAndAnimate function to WindowManagerInternalClient (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Add GetView(ClonedViewId) coverage Created 6 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 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 937f43705b9aacd0260f62fb5341168e5cb4c296..991ab8e0d1f1db3603a852912a86bcbc6585a29a 100644
--- a/mojo/services/view_manager/server_view.cc
+++ b/mojo/services/view_manager/server_view.cc
@@ -10,11 +10,13 @@ namespace mojo {
namespace service {
ServerView::ServerView(ServerViewDelegate* delegate, const ViewId& id)
- : delegate_(delegate), id_(id), parent_(NULL), visible_(true) {
+ : delegate_(delegate), id_(id), parent_(NULL), visible_(true), opacity_(1) {
DCHECK(delegate); // Must provide a delegate.
}
ServerView::~ServerView() {
+ delegate_->OnWillDestroyView(this);
+
while (!children_.empty())
children_.front()->parent()->Remove(children_.front());
@@ -36,7 +38,7 @@ void ServerView::Add(ServerView* child) {
return;
}
- const ServerView* old_parent = child->parent();
+ ServerView* old_parent = child->parent();
child->delegate_->OnWillChangeViewHierarchy(child, this, old_parent);
if (child->parent())
child->parent()->RemoveImpl(child);
@@ -121,6 +123,13 @@ void ServerView::SetVisible(bool value) {
visible_ = value;
}
+void ServerView::SetOpacity(float value) {
+ if (value == opacity_)
+ return;
+ opacity_ = value;
+ delegate_->OnScheduleViewPaint(this);
+}
+
void ServerView::SetProperty(const std::string& name,
const std::vector<uint8_t>* value) {
auto it = properties_.find(name);
« 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