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

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: Created 5 years, 11 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 (originated_change || !IsViewKnown(view))
sky 2015/01/27 16:35:08 This is only going to notify clients that know of
eseidel 2015/01/27 18:50:04 I just copied this from ProcessBoundsChanged. :/
184 return;
185 client()->OnViewViewportMetricsChanged(ViewIdToTransportId(view->id()),
186 old_metrics.Clone(),
187 new_metrics.Clone());
188 }
189
178 void ViewManagerServiceImpl::ProcessWillChangeViewHierarchy( 190 void ViewManagerServiceImpl::ProcessWillChangeViewHierarchy(
179 const ServerView* view, 191 const ServerView* view,
180 const ServerView* new_parent, 192 const ServerView* new_parent,
181 const ServerView* old_parent, 193 const ServerView* old_parent,
182 bool originated_change) { 194 bool originated_change) {
183 if (originated_change) 195 if (originated_change)
184 return; 196 return;
185 197
186 const bool old_drawn = view->IsDrawn(connection_manager_->root()); 198 const bool old_drawn = view->IsDrawn(connection_manager_->root());
187 const bool new_drawn = view->visible() && new_parent && 199 const bool new_drawn = view->visible() && new_parent &&
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 } 618 }
607 619
608 bool ViewManagerServiceImpl::IsViewRootOfAnotherConnectionForAccessPolicy( 620 bool ViewManagerServiceImpl::IsViewRootOfAnotherConnectionForAccessPolicy(
609 const ServerView* view) const { 621 const ServerView* view) const {
610 ViewManagerServiceImpl* connection = 622 ViewManagerServiceImpl* connection =
611 connection_manager_->GetConnectionWithRoot(view->id()); 623 connection_manager_->GetConnectionWithRoot(view->id());
612 return connection && connection != this; 624 return connection && connection != this;
613 } 625 }
614 626
615 } // namespace view_manager 627 } // namespace view_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698