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

Side by Side Diff: components/view_manager/view_manager_root_impl.cc

Issue 1245683004: Mandoline: Merge Surfaces and Views apps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed bot issues (I hope) Created 5 years, 4 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 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"
11 #include "mojo/converters/geometry/geometry_type_converters.h" 11 #include "mojo/converters/geometry/geometry_type_converters.h"
12 12
13 namespace view_manager { 13 namespace view_manager {
14 14
15 ViewManagerRootImpl::ViewManagerRootImpl( 15 ViewManagerRootImpl::ViewManagerRootImpl(
16 ConnectionManager* connection_manager, 16 ConnectionManager* connection_manager,
17 bool is_headless, 17 bool is_headless,
18 mojo::ApplicationImpl* app_impl, 18 mojo::ApplicationImpl* app_impl,
19 const scoped_refptr<gles2::GpuState>& gpu_state) 19 const scoped_refptr<gles2::GpuState>& gpu_state,
20 const scoped_refptr<surfaces::SurfacesState>& surfaces_state)
20 : delegate_(nullptr), 21 : delegate_(nullptr),
21 connection_manager_(connection_manager), 22 connection_manager_(connection_manager),
22 display_manager_( 23 display_manager_(
23 DisplayManager::Create(is_headless, app_impl, gpu_state)) { 24 DisplayManager::Create(is_headless,
25 app_impl,
26 gpu_state,
27 surfaces_state)) {
24 display_manager_->Init(this); 28 display_manager_->Init(this);
25 } 29 }
26 30
27 ViewManagerRootImpl::~ViewManagerRootImpl() { 31 ViewManagerRootImpl::~ViewManagerRootImpl() {
28 } 32 }
29 33
30 void ViewManagerRootImpl::Init(ViewManagerRootDelegate* delegate) { 34 void ViewManagerRootImpl::Init(ViewManagerRootDelegate* delegate) {
31 delegate_ = delegate; 35 delegate_ = delegate;
32 if (delegate_ && root_) 36 if (delegate_ && root_)
33 delegate_->OnDisplayInitialized(); 37 delegate_->OnDisplayInitialized();
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 delegate_->OnDisplayInitialized(); 116 delegate_->OnDisplayInitialized();
113 } else { 117 } else {
114 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>()));
115 } 119 }
116 // 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
117 // those within a window root. 121 // those within a window root.
118 connection_manager_->ProcessViewportMetricsChanged(old_metrics, new_metrics); 122 connection_manager_->ProcessViewportMetricsChanged(old_metrics, new_metrics);
119 } 123 }
120 124
121 } // namespace view_manager 125 } // namespace view_manager
OLDNEW
« no previous file with comments | « components/view_manager/view_manager_root_impl.h ('k') | components/view_manager/view_manager_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698