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

Side by Side Diff: ui/views/mus/screen_mus.cc

Issue 2503063003: Add service name constant for UI service. (Closed)
Patch Set: . Created 4 years, 1 month 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 | « ui/views/mus/input_method_mus.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 // This has to be before any other includes, else default is picked up. 5 // This has to be before any other includes, else default is picked up.
6 // See base/logging for details on this. 6 // See base/logging for details on this.
7 #define NOTIMPLEMENTED_POLICY 5 7 #define NOTIMPLEMENTED_POLICY 5
8 8
9 #include "ui/views/mus/screen_mus.h" 9 #include "ui/views/mus/screen_mus.h"
10 10
11 #include "services/service_manager/public/cpp/connection.h" 11 #include "services/service_manager/public/cpp/connection.h"
12 #include "services/service_manager/public/cpp/connector.h" 12 #include "services/service_manager/public/cpp/connector.h"
13 #include "services/ui/public/interfaces/constants.mojom.h"
13 #include "ui/aura/window.h" 14 #include "ui/aura/window.h"
14 #include "ui/views/mus/native_widget_mus.h" 15 #include "ui/views/mus/native_widget_mus.h"
15 #include "ui/views/mus/screen_mus_delegate.h" 16 #include "ui/views/mus/screen_mus_delegate.h"
16 #include "ui/views/mus/window_manager_frame_values.h" 17 #include "ui/views/mus/window_manager_frame_values.h"
17 18
18 namespace mojo { 19 namespace mojo {
19 20
20 template <> 21 template <>
21 struct TypeConverter<views::WindowManagerFrameValues, 22 struct TypeConverter<views::WindowManagerFrameValues,
22 ui::mojom::FrameDecorationValuesPtr> { 23 ui::mojom::FrameDecorationValuesPtr> {
(...skipping 17 matching lines...) Expand all
40 : delegate_(delegate), display_manager_observer_binding_(this) { 41 : delegate_(delegate), display_manager_observer_binding_(this) {
41 display::Screen::SetScreenInstance(this); 42 display::Screen::SetScreenInstance(this);
42 } 43 }
43 44
44 ScreenMus::~ScreenMus() { 45 ScreenMus::~ScreenMus() {
45 DCHECK_EQ(this, display::Screen::GetScreen()); 46 DCHECK_EQ(this, display::Screen::GetScreen());
46 display::Screen::SetScreenInstance(nullptr); 47 display::Screen::SetScreenInstance(nullptr);
47 } 48 }
48 49
49 void ScreenMus::Init(service_manager::Connector* connector) { 50 void ScreenMus::Init(service_manager::Connector* connector) {
50 connector->ConnectToInterface("ui", &display_manager_); 51 connector->ConnectToInterface(ui::mojom::kServiceName, &display_manager_);
51 52
52 display_manager_->AddObserver( 53 display_manager_->AddObserver(
53 display_manager_observer_binding_.CreateInterfacePtrAndBind()); 54 display_manager_observer_binding_.CreateInterfacePtrAndBind());
54 55
55 // We need the set of displays before we can continue. Wait for it. 56 // We need the set of displays before we can continue. Wait for it.
56 // 57 //
57 // TODO(rockot): Do something better here. This should not have to block tasks 58 // TODO(rockot): Do something better here. This should not have to block tasks
58 // from running on the calling thread. http://crbug.com/594852. 59 // from running on the calling thread. http://crbug.com/594852.
59 bool success = display_manager_observer_binding_.WaitForIncomingMethodCall(); 60 bool success = display_manager_observer_binding_.WaitForIncomingMethodCall();
60 61
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 // TODO(kylechar): DisplayList would need to change to handle having no 146 // TODO(kylechar): DisplayList would need to change to handle having no
146 // primary display. 147 // primary display.
147 if (primary_display_id == display::Display::kInvalidDisplayID) 148 if (primary_display_id == display::Display::kInvalidDisplayID)
148 return; 149 return;
149 150
150 ProcessDisplayChanged(*display_list().FindDisplayById(primary_display_id), 151 ProcessDisplayChanged(*display_list().FindDisplayById(primary_display_id),
151 true); 152 true);
152 } 153 }
153 154
154 } // namespace views 155 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/mus/input_method_mus.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698