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

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

Issue 1881253002: mus: Implement ScreenMus::GetCursorScreenPoint(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add another comment Created 4 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
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 #include "ui/views/mus/screen_mus.h" 5 #include "ui/views/mus/screen_mus.h"
6 6
7 #include "mojo/converters/geometry/geometry_type_converters.h" 7 #include "mojo/converters/geometry/geometry_type_converters.h"
8 #include "services/shell/public/cpp/connection.h" 8 #include "services/shell/public/cpp/connection.h"
9 #include "services/shell/public/cpp/connector.h" 9 #include "services/shell/public/cpp/connector.h"
10 #include "ui/display/display_observer.h" 10 #include "ui/display/display_observer.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 73 }
74 }; 74 };
75 75
76 } // namespace mojo 76 } // namespace mojo
77 77
78 namespace views { 78 namespace views {
79 79
80 ScreenMus::ScreenMus(ScreenMusDelegate* delegate) 80 ScreenMus::ScreenMus(ScreenMusDelegate* delegate)
81 : delegate_(delegate), 81 : delegate_(delegate),
82 primary_display_index_(0), 82 primary_display_index_(0),
83 display_manager_observer_binding_(this) {} 83 display_manager_observer_binding_(this) {
84 }
84 85
85 ScreenMus::~ScreenMus() {} 86 ScreenMus::~ScreenMus() {}
86 87
87 void ScreenMus::Init(shell::Connector* connector) { 88 void ScreenMus::Init(shell::Connector* connector) {
88 display::Screen::SetScreenInstance(this); 89 display::Screen::SetScreenInstance(this);
89 90
90 connector->ConnectToInterface("mojo:mus", &display_manager_); 91 connector->ConnectToInterface("mojo:mus", &display_manager_);
91 92
92 display_manager_->AddObserver( 93 display_manager_->AddObserver(
93 display_manager_observer_binding_.CreateInterfacePtrAndBind()); 94 display_manager_observer_binding_.CreateInterfacePtrAndBind());
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 local_display->set_device_scale_factor( 154 local_display->set_device_scale_factor(
154 changed_display.device_scale_factor()); 155 changed_display.device_scale_factor());
155 changed_values |= 156 changed_values |=
156 display::DisplayObserver::DISPLAY_METRIC_DEVICE_SCALE_FACTOR; 157 display::DisplayObserver::DISPLAY_METRIC_DEVICE_SCALE_FACTOR;
157 } 158 }
158 FOR_EACH_OBSERVER(display::DisplayObserver, observers_, 159 FOR_EACH_OBSERVER(display::DisplayObserver, observers_,
159 OnDisplayMetricsChanged(*local_display, changed_values)); 160 OnDisplayMetricsChanged(*local_display, changed_values));
160 } 161 }
161 162
162 gfx::Point ScreenMus::GetCursorScreenPoint() { 163 gfx::Point ScreenMus::GetCursorScreenPoint() {
163 NOTIMPLEMENTED(); 164 if (!delegate_) {
164 return gfx::Point(); 165 // TODO(erg): If we need the cursor point in the window manager, we'll need
166 // to make |delegate_| required. It only recently changed to be optional.
167 NOTIMPLEMENTED();
168 return gfx::Point();
169 }
170
171 return delegate_->GetCursorScreenPoint();
165 } 172 }
166 173
167 gfx::NativeWindow ScreenMus::GetWindowUnderCursor() { 174 gfx::NativeWindow ScreenMus::GetWindowUnderCursor() {
168 NOTIMPLEMENTED(); 175 NOTIMPLEMENTED();
169 return nullptr; 176 return nullptr;
170 } 177 }
171 178
172 gfx::NativeWindow ScreenMus::GetWindowAtScreenPoint(const gfx::Point& point) { 179 gfx::NativeWindow ScreenMus::GetWindowAtScreenPoint(const gfx::Point& point) {
173 NOTIMPLEMENTED(); 180 NOTIMPLEMENTED();
174 return nullptr; 181 return nullptr;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 DCHECK_NE(-1, index); 258 DCHECK_NE(-1, index);
252 // Another display must become primary before the existing primary is 259 // Another display must become primary before the existing primary is
253 // removed. 260 // removed.
254 DCHECK_NE(index, primary_display_index_); 261 DCHECK_NE(index, primary_display_index_);
255 const display::Display display = displays_[index]; 262 const display::Display display = displays_[index];
256 FOR_EACH_OBSERVER(display::DisplayObserver, observers_, 263 FOR_EACH_OBSERVER(display::DisplayObserver, observers_,
257 OnDisplayRemoved(display)); 264 OnDisplayRemoved(display));
258 } 265 }
259 266
260 } // namespace views 267 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698