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 "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
10 #include "mojo/converters/geometry/geometry_type_converters.h" | 10 #include "mojo/converters/geometry/geometry_type_converters.h" |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 ServerView* view = GetView(view_id); | 396 ServerView* view = GetView(view_id); |
397 CHECK(view); | 397 CHECK(view); |
398 CHECK(view->id().connection_id == view_id.connection_id); | 398 CHECK(view->id().connection_id == view_id.connection_id); |
399 std::vector<ServerView*> children = view->GetChildren(); | 399 std::vector<ServerView*> children = view->GetChildren(); |
400 for (size_t i = 0; i < children.size(); ++i) | 400 for (size_t i = 0; i < children.size(); ++i) |
401 view->Remove(children[i]); | 401 view->Remove(children[i]); |
402 } | 402 } |
403 | 403 |
404 Array<ViewDataPtr> ViewManagerServiceImpl::ViewsToViewDatas( | 404 Array<ViewDataPtr> ViewManagerServiceImpl::ViewsToViewDatas( |
405 const std::vector<const ServerView*>& views) { | 405 const std::vector<const ServerView*>& views) { |
406 Array<ViewDataPtr> array(views.size()); | 406 auto array = Array<ViewDataPtr>::New(views.size()); |
407 for (size_t i = 0; i < views.size(); ++i) | 407 for (size_t i = 0; i < views.size(); ++i) |
408 array[i] = ViewToViewData(views[i]).Pass(); | 408 array[i] = ViewToViewData(views[i]).Pass(); |
409 return array.Pass(); | 409 return array.Pass(); |
410 } | 410 } |
411 | 411 |
412 ViewDataPtr ViewManagerServiceImpl::ViewToViewData(const ServerView* view) { | 412 ViewDataPtr ViewManagerServiceImpl::ViewToViewData(const ServerView* view) { |
413 DCHECK(IsViewKnown(view)); | 413 DCHECK(IsViewKnown(view)); |
414 const ServerView* parent = view->parent(); | 414 const ServerView* parent = view->parent(); |
415 // If the parent isn't known, it means the parent is not visible to us (not | 415 // If the parent isn't known, it means the parent is not visible to us (not |
416 // in roots), and should not be sent over. | 416 // in roots), and should not be sent over. |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 } | 647 } |
648 | 648 |
649 bool ViewManagerServiceImpl::IsViewRootOfAnotherConnectionForAccessPolicy( | 649 bool ViewManagerServiceImpl::IsViewRootOfAnotherConnectionForAccessPolicy( |
650 const ServerView* view) const { | 650 const ServerView* view) const { |
651 ViewManagerServiceImpl* connection = | 651 ViewManagerServiceImpl* connection = |
652 connection_manager_->GetConnectionWithRoot(view->id()); | 652 connection_manager_->GetConnectionWithRoot(view->id()); |
653 return connection && connection != this; | 653 return connection && connection != this; |
654 } | 654 } |
655 | 655 |
656 } // namespace view_manager | 656 } // namespace view_manager |
OLD | NEW |