OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/view_manager/view_manager_root_impl.h" | 5 #include "components/view_manager/view_manager_root_impl.h" |
6 | 6 |
7 #include "components/view_manager/connection_manager.h" | 7 #include "components/view_manager/connection_manager.h" |
8 #include "components/view_manager/display_manager.h" | 8 #include "components/view_manager/display_manager.h" |
9 #include "components/view_manager/public/cpp/types.h" | 9 #include "components/view_manager/public/cpp/types.h" |
10 #include "components/view_manager/view_manager_root_delegate.h" | 10 #include "components/view_manager/view_manager_root_delegate.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 ViewManagerRootImpl::~ViewManagerRootImpl() { | 31 ViewManagerRootImpl::~ViewManagerRootImpl() { |
32 } | 32 } |
33 | 33 |
34 void ViewManagerRootImpl::Init(ViewManagerRootDelegate* delegate) { | 34 void ViewManagerRootImpl::Init(ViewManagerRootDelegate* delegate) { |
35 delegate_ = delegate; | 35 delegate_ = delegate; |
36 if (delegate_ && root_) | 36 if (delegate_ && root_) |
37 delegate_->OnDisplayInitialized(); | 37 delegate_->OnDisplayInitialized(); |
38 } | 38 } |
39 | 39 |
40 ViewManagerServiceImpl* ViewManagerRootImpl::GetViewManagerService() { | 40 ViewTreeImpl* ViewManagerRootImpl::GetViewTree() { |
41 return delegate_ ? delegate_->GetViewManagerService() : nullptr; | 41 return delegate_ ? delegate_->GetViewTree() : nullptr; |
42 } | 42 } |
43 | 43 |
44 bool ViewManagerRootImpl::IsViewAttachedToRoot(const ServerView* view) const { | 44 bool ViewManagerRootImpl::IsViewAttachedToRoot(const ServerView* view) const { |
45 return root_->Contains(view) && view != root_.get(); | 45 return root_->Contains(view) && view != root_.get(); |
46 } | 46 } |
47 | 47 |
48 bool ViewManagerRootImpl::SchedulePaintIfInViewport(const ServerView* view, | 48 bool ViewManagerRootImpl::SchedulePaintIfInViewport(const ServerView* view, |
49 const gfx::Rect& bounds) { | 49 const gfx::Rect& bounds) { |
50 if (root_->Contains(view)) { | 50 if (root_->Contains(view)) { |
51 display_manager_->SchedulePaint(view, bounds); | 51 display_manager_->SchedulePaint(view, bounds); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 delegate_->OnDisplayInitialized(); | 116 delegate_->OnDisplayInitialized(); |
117 } else { | 117 } else { |
118 root_->SetBounds(gfx::Rect(new_metrics.size_in_pixels.To<gfx::Size>())); | 118 root_->SetBounds(gfx::Rect(new_metrics.size_in_pixels.To<gfx::Size>())); |
119 } | 119 } |
120 // TODO(fsamuel): We shouldn't broadcast this to all connections but only | 120 // TODO(fsamuel): We shouldn't broadcast this to all connections but only |
121 // those within a window root. | 121 // those within a window root. |
122 connection_manager_->ProcessViewportMetricsChanged(old_metrics, new_metrics); | 122 connection_manager_->ProcessViewportMetricsChanged(old_metrics, new_metrics); |
123 } | 123 } |
124 | 124 |
125 } // namespace view_manager | 125 } // namespace view_manager |
OLD | NEW |