| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |