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

Side by Side Diff: services/view_manager/view_manager_service_apptest.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, 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/message_loop/message_loop.h" 6 #include "base/message_loop/message_loop.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "mojo/public/cpp/application/application_delegate.h" 8 #include "mojo/public/cpp/application/application_delegate.h"
9 #include "mojo/public/cpp/application/application_impl.h" 9 #include "mojo/public/cpp/application/application_impl.h"
10 #include "mojo/public/cpp/application/application_test_base.h" 10 #include "mojo/public/cpp/application/application_test_base.h"
(...skipping 16 matching lines...) Expand all
27 using mojo::ORDER_DIRECTION_ABOVE; 27 using mojo::ORDER_DIRECTION_ABOVE;
28 using mojo::ORDER_DIRECTION_BELOW; 28 using mojo::ORDER_DIRECTION_BELOW;
29 using mojo::OrderDirection; 29 using mojo::OrderDirection;
30 using mojo::RectPtr; 30 using mojo::RectPtr;
31 using mojo::ServiceProvider; 31 using mojo::ServiceProvider;
32 using mojo::ServiceProviderPtr; 32 using mojo::ServiceProviderPtr;
33 using mojo::String; 33 using mojo::String;
34 using mojo::ViewDataPtr; 34 using mojo::ViewDataPtr;
35 using mojo::ViewManagerClient; 35 using mojo::ViewManagerClient;
36 using mojo::ViewManagerService; 36 using mojo::ViewManagerService;
37 using mojo::ViewportMetricsPtr;
37 38
38 namespace view_manager { 39 namespace view_manager {
39 40
40 // Creates an id used for transport from the specified parameters. 41 // Creates an id used for transport from the specified parameters.
41 Id BuildViewId(ConnectionSpecificId connection_id, 42 Id BuildViewId(ConnectionSpecificId connection_id,
42 ConnectionSpecificId view_id) { 43 ConnectionSpecificId view_id) {
43 return (connection_id << 16) | view_id; 44 return (connection_id << 16) | view_id;
44 } 45 }
45 46
46 // Callback function from ViewManagerService functions. ------------------------ 47 // Callback function from ViewManagerService functions. ------------------------
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 } 275 }
275 void OnEmbeddedAppDisconnected(Id view_id) override { 276 void OnEmbeddedAppDisconnected(Id view_id) override {
276 tracker()->OnEmbeddedAppDisconnected(view_id); 277 tracker()->OnEmbeddedAppDisconnected(view_id);
277 } 278 }
278 void OnViewBoundsChanged(Id view_id, 279 void OnViewBoundsChanged(Id view_id,
279 RectPtr old_bounds, 280 RectPtr old_bounds,
280 RectPtr new_bounds) override { 281 RectPtr new_bounds) override {
281 tracker()->OnViewBoundsChanged(view_id, old_bounds.Pass(), 282 tracker()->OnViewBoundsChanged(view_id, old_bounds.Pass(),
282 new_bounds.Pass()); 283 new_bounds.Pass());
283 } 284 }
285 void OnViewViewportMetricsChanged(Id view_id,
286 ViewportMetricsPtr old_metrics,
287 ViewportMetricsPtr new_metrics) override {
288 tracker()->OnViewViewportMetricsChanged(view_id, old_metrics.Pass(),
289 new_metrics.Pass());
290 }
284 void OnViewHierarchyChanged(Id view, 291 void OnViewHierarchyChanged(Id view,
285 Id new_parent, 292 Id new_parent,
286 Id old_parent, 293 Id old_parent,
287 Array<ViewDataPtr> views) override { 294 Array<ViewDataPtr> views) override {
288 tracker()->OnViewHierarchyChanged(view, new_parent, old_parent, 295 tracker()->OnViewHierarchyChanged(view, new_parent, old_parent,
289 views.Pass()); 296 views.Pass());
290 } 297 }
291 void OnViewReordered(Id view_id, 298 void OnViewReordered(Id view_id,
292 Id relative_view_id, 299 Id relative_view_id,
293 OrderDirection direction) override { 300 OrderDirection direction) override {
(...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 // TODO(sky): need to better track changes to initial connection. For example, 1421 // TODO(sky): need to better track changes to initial connection. For example,
1415 // that SetBounsdViews/AddView and the like don't result in messages to the 1422 // that SetBounsdViews/AddView and the like don't result in messages to the
1416 // originating connection. 1423 // originating connection.
1417 1424
1418 // TODO(sky): make sure coverage of what was 1425 // TODO(sky): make sure coverage of what was
1419 // ViewManagerTest.SecondEmbedRoot_InitService and 1426 // ViewManagerTest.SecondEmbedRoot_InitService and
1420 // ViewManagerTest.MultipleEmbedRootsBeforeWTHReady gets added to window manager 1427 // ViewManagerTest.MultipleEmbedRootsBeforeWTHReady gets added to window manager
1421 // tests. 1428 // tests.
1422 1429
1423 } // namespace view_manager 1430 } // namespace view_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698