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

Side by Side Diff: services/ui/display/screen_manager_forwarding.cc

Issue 2833093002: WIP: simplified display management in ash (Closed)
Patch Set: x Created 3 years, 7 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
« no previous file with comments | « mash/package/mash_packaged_service.cc ('k') | services/ui/ws/window_server.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/ui/display/screen_manager_forwarding.h" 5 #include "services/ui/display/screen_manager_forwarding.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "services/service_manager/public/cpp/binder_registry.h" 10 #include "services/service_manager/public/cpp/binder_registry.h"
(...skipping 19 matching lines...) Expand all
30 return mode.get(); 30 return mode.get();
31 } 31 }
32 } 32 }
33 NOTREACHED(); 33 NOTREACHED();
34 return nullptr; 34 return nullptr;
35 } 35 }
36 36
37 } // namespace 37 } // namespace
38 38
39 ScreenManagerForwarding::ScreenManagerForwarding() 39 ScreenManagerForwarding::ScreenManagerForwarding()
40 : screen_(base::MakeUnique<display::ScreenBase>()), binding_(this) {} 40 : screen_(base::MakeUnique<display::ScreenBase>()), binding_(this) {
41 Screen::SetScreenInstance(screen_.get());
42 }
41 43
42 ScreenManagerForwarding::~ScreenManagerForwarding() { 44 ScreenManagerForwarding::~ScreenManagerForwarding() {
43 if (native_display_delegate_) 45 if (native_display_delegate_)
44 native_display_delegate_->RemoveObserver(this); 46 native_display_delegate_->RemoveObserver(this);
47 Screen::SetScreenInstance(nullptr);
45 } 48 }
46 49
47 void ScreenManagerForwarding::AddInterfaces( 50 void ScreenManagerForwarding::AddInterfaces(
48 service_manager::BinderRegistry* registry) { 51 service_manager::BinderRegistry* registry) {
52 // registry->AddInterface<mojom::DisplayController>(this);
49 registry->AddInterface<mojom::NativeDisplayDelegate>(this); 53 registry->AddInterface<mojom::NativeDisplayDelegate>(this);
50 } 54 }
51 55
52 void ScreenManagerForwarding::Init(ScreenManagerDelegate* delegate) { 56 void ScreenManagerForwarding::Init(ScreenManagerDelegate* delegate) {
53 // Done in NativeDisplayDelegate::Initialize() instead. 57 // Done in NativeDisplayDelegate::Initialize() instead.
54 } 58 }
55 59
56 void ScreenManagerForwarding::RequestCloseDisplay(int64_t display_id) {} 60 void ScreenManagerForwarding::RequestCloseDisplay(int64_t display_id) {}
57 61
58 display::ScreenBase* ScreenManagerForwarding::GetScreen() { 62 display::ScreenBase* ScreenManagerForwarding::GetScreen() {
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 if (status) { 198 if (status) {
195 // Modify display snapshot similar to how ConfigureDisplaysTask would. Ozone 199 // Modify display snapshot similar to how ConfigureDisplaysTask would. Ozone
196 // DRM needs these to be changed and ConfigureDisplaysTasks can't do it. 200 // DRM needs these to be changed and ConfigureDisplaysTasks can't do it.
197 snapshot->set_current_mode(mode); 201 snapshot->set_current_mode(mode);
198 snapshot->set_origin(origin); 202 snapshot->set_origin(origin);
199 } 203 }
200 callback.Run(status); 204 callback.Run(status);
201 } 205 }
202 206
203 } // namespace display 207 } // namespace display
OLDNEW
« no previous file with comments | « mash/package/mash_packaged_service.cc ('k') | services/ui/ws/window_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698