OLD | NEW |
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 |
(...skipping 29 matching lines...) Expand all Loading... |
40 : delegate_(delegate), display_manager_observer_binding_(this) { | 40 : delegate_(delegate), display_manager_observer_binding_(this) { |
41 display::Screen::SetScreenInstance(this); | 41 display::Screen::SetScreenInstance(this); |
42 } | 42 } |
43 | 43 |
44 ScreenMus::~ScreenMus() { | 44 ScreenMus::~ScreenMus() { |
45 DCHECK_EQ(this, display::Screen::GetScreen()); | 45 DCHECK_EQ(this, display::Screen::GetScreen()); |
46 display::Screen::SetScreenInstance(nullptr); | 46 display::Screen::SetScreenInstance(nullptr); |
47 } | 47 } |
48 | 48 |
49 void ScreenMus::Init(service_manager::Connector* connector) { | 49 void ScreenMus::Init(service_manager::Connector* connector) { |
50 connector->ConnectToInterface(ui::mojom::kServiceName, &display_manager_); | 50 connector->BindInterface(ui::mojom::kServiceName, &display_manager_); |
51 | 51 |
52 display_manager_->AddObserver( | 52 display_manager_->AddObserver( |
53 display_manager_observer_binding_.CreateInterfacePtrAndBind()); | 53 display_manager_observer_binding_.CreateInterfacePtrAndBind()); |
54 | 54 |
55 // We need the set of displays before we can continue. Wait for it. | 55 // We need the set of displays before we can continue. Wait for it. |
56 // | 56 // |
57 // TODO(rockot): Do something better here. This should not have to block tasks | 57 // TODO(rockot): Do something better here. This should not have to block tasks |
58 // from running on the calling thread. http://crbug.com/594852. | 58 // from running on the calling thread. http://crbug.com/594852. |
59 bool success = display_manager_observer_binding_.WaitForIncomingMethodCall(); | 59 bool success = display_manager_observer_binding_.WaitForIncomingMethodCall(); |
60 | 60 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 // TODO(kylechar): DisplayList would need to change to handle having no | 145 // TODO(kylechar): DisplayList would need to change to handle having no |
146 // primary display. | 146 // primary display. |
147 if (primary_display_id == display::kInvalidDisplayId) | 147 if (primary_display_id == display::kInvalidDisplayId) |
148 return; | 148 return; |
149 | 149 |
150 ProcessDisplayChanged(*display_list().FindDisplayById(primary_display_id), | 150 ProcessDisplayChanged(*display_list().FindDisplayById(primary_display_id), |
151 true); | 151 true); |
152 } | 152 } |
153 | 153 |
154 } // namespace views | 154 } // namespace views |
OLD | NEW |