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

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: Merge with tot 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
« no previous file with comments | « components/mus/ws/window_tree.cc ('k') | ui/views/mus/screen_mus_delegate.h » ('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 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 local_display->set_device_scale_factor( 155 local_display->set_device_scale_factor(
155 changed_display.device_scale_factor()); 156 changed_display.device_scale_factor());
156 changed_values |= 157 changed_values |=
157 display::DisplayObserver::DISPLAY_METRIC_DEVICE_SCALE_FACTOR; 158 display::DisplayObserver::DISPLAY_METRIC_DEVICE_SCALE_FACTOR;
158 } 159 }
159 FOR_EACH_OBSERVER(display::DisplayObserver, observers_, 160 FOR_EACH_OBSERVER(display::DisplayObserver, observers_,
160 OnDisplayMetricsChanged(*local_display, changed_values)); 161 OnDisplayMetricsChanged(*local_display, changed_values));
161 } 162 }
162 163
163 gfx::Point ScreenMus::GetCursorScreenPoint() { 164 gfx::Point ScreenMus::GetCursorScreenPoint() {
164 NOTIMPLEMENTED(); 165 if (!delegate_) {
165 return gfx::Point(); 166 // TODO(erg): If we need the cursor point in the window manager, we'll need
167 // to make |delegate_| required. It only recently changed to be optional.
168 NOTIMPLEMENTED();
169 return gfx::Point();
170 }
171
172 return delegate_->GetCursorScreenPoint();
166 } 173 }
167 174
168 gfx::NativeWindow ScreenMus::GetWindowUnderCursor() { 175 gfx::NativeWindow ScreenMus::GetWindowUnderCursor() {
169 NOTIMPLEMENTED(); 176 NOTIMPLEMENTED();
170 return nullptr; 177 return nullptr;
171 } 178 }
172 179
173 gfx::NativeWindow ScreenMus::GetWindowAtScreenPoint(const gfx::Point& point) { 180 gfx::NativeWindow ScreenMus::GetWindowAtScreenPoint(const gfx::Point& point) {
174 NOTIMPLEMENTED(); 181 NOTIMPLEMENTED();
175 return nullptr; 182 return nullptr;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 DCHECK_NE(-1, index); 259 DCHECK_NE(-1, index);
253 // Another display must become primary before the existing primary is 260 // Another display must become primary before the existing primary is
254 // removed. 261 // removed.
255 DCHECK_NE(index, primary_display_index_); 262 DCHECK_NE(index, primary_display_index_);
256 const display::Display display = displays_[index]; 263 const display::Display display = displays_[index];
257 FOR_EACH_OBSERVER(display::DisplayObserver, observers_, 264 FOR_EACH_OBSERVER(display::DisplayObserver, observers_,
258 OnDisplayRemoved(display)); 265 OnDisplayRemoved(display));
259 } 266 }
260 267
261 } // namespace views 268 } // namespace views
OLDNEW
« no previous file with comments | « components/mus/ws/window_tree.cc ('k') | ui/views/mus/screen_mus_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698