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

Side by Side Diff: services/view_manager/view_manager_service_impl.cc

Issue 880743002: Plumb ViewportMetrics change notifications around the world and back. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Now without skydb changes Created 5 years, 10 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 "services/view_manager/view_manager_service_impl.h" 5 #include "services/view_manager/view_manager_service_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "mojo/converters/geometry/geometry_type_converters.h" 9 #include "mojo/converters/geometry/geometry_type_converters.h"
10 #include "mojo/converters/input_events/input_events_type_converters.h" 10 #include "mojo/converters/input_events/input_events_type_converters.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 const gfx::Rect& old_bounds, 168 const gfx::Rect& old_bounds,
169 const gfx::Rect& new_bounds, 169 const gfx::Rect& new_bounds,
170 bool originated_change) { 170 bool originated_change) {
171 if (originated_change || !IsViewKnown(view)) 171 if (originated_change || !IsViewKnown(view))
172 return; 172 return;
173 client()->OnViewBoundsChanged(ViewIdToTransportId(view->id()), 173 client()->OnViewBoundsChanged(ViewIdToTransportId(view->id()),
174 Rect::From(old_bounds), 174 Rect::From(old_bounds),
175 Rect::From(new_bounds)); 175 Rect::From(new_bounds));
176 } 176 }
177 177
178 void ViewManagerServiceImpl::ProcessViewportMetricsChanged(
179 const ServerView* view,
180 const mojo::ViewportMetrics& old_metrics,
181 const mojo::ViewportMetrics& new_metrics,
182 bool originated_change) {
183 if (!root())
184 return;
185 client()->OnViewViewportMetricsChanged(
186 ViewIdToTransportId(*root()), old_metrics.Clone(), new_metrics.Clone());
187 }
188
178 void ViewManagerServiceImpl::ProcessWillChangeViewHierarchy( 189 void ViewManagerServiceImpl::ProcessWillChangeViewHierarchy(
179 const ServerView* view, 190 const ServerView* view,
180 const ServerView* new_parent, 191 const ServerView* new_parent,
181 const ServerView* old_parent, 192 const ServerView* old_parent,
182 bool originated_change) { 193 bool originated_change) {
183 if (originated_change) 194 if (originated_change)
184 return; 195 return;
185 196
186 const bool old_drawn = view->IsDrawn(connection_manager_->root()); 197 const bool old_drawn = view->IsDrawn(connection_manager_->root());
187 const bool new_drawn = view->visible() && new_parent && 198 const bool new_drawn = view->visible() && new_parent &&
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 } 617 }
607 618
608 bool ViewManagerServiceImpl::IsViewRootOfAnotherConnectionForAccessPolicy( 619 bool ViewManagerServiceImpl::IsViewRootOfAnotherConnectionForAccessPolicy(
609 const ServerView* view) const { 620 const ServerView* view) const {
610 ViewManagerServiceImpl* connection = 621 ViewManagerServiceImpl* connection =
611 connection_manager_->GetConnectionWithRoot(view->id()); 622 connection_manager_->GetConnectionWithRoot(view->id());
612 return connection && connection != this; 623 return connection && connection != this;
613 } 624 }
614 625
615 } // namespace view_manager 626 } // namespace view_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698