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 #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/aura/window.h" | |
10 #include "ui/display/display_observer.h" | 11 #include "ui/display/display_observer.h" |
11 #include "ui/gfx/display_finder.h" | 12 #include "ui/gfx/display_finder.h" |
12 #include "ui/views/mus/screen_mus_delegate.h" | 13 #include "ui/views/mus/screen_mus_delegate.h" |
13 #include "ui/views/mus/window_manager_frame_values.h" | 14 #include "ui/views/mus/window_manager_frame_values.h" |
14 | 15 |
15 namespace mojo { | 16 namespace mojo { |
16 | 17 |
17 template <> | 18 template <> |
18 struct TypeConverter<display::Display, mus::mojom::DisplayPtr> { | 19 struct TypeConverter<display::Display, mus::mojom::DisplayPtr> { |
19 static display::Display Convert(const mus::mojom::DisplayPtr& input) { | 20 static display::Display Convert(const mus::mojom::DisplayPtr& input) { |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
166 if (!delegate_) { | 167 if (!delegate_) { |
167 // TODO(erg): If we need the cursor point in the window manager, we'll need | 168 // TODO(erg): If we need the cursor point in the window manager, we'll need |
168 // to make |delegate_| required. It only recently changed to be optional. | 169 // to make |delegate_| required. It only recently changed to be optional. |
169 NOTIMPLEMENTED(); | 170 NOTIMPLEMENTED(); |
170 return gfx::Point(); | 171 return gfx::Point(); |
171 } | 172 } |
172 | 173 |
173 return delegate_->GetCursorScreenPoint(); | 174 return delegate_->GetCursorScreenPoint(); |
174 } | 175 } |
175 | 176 |
176 gfx::NativeWindow ScreenMus::GetWindowUnderCursor() { | 177 bool ScreenMus::IsWindowUnderCursor(gfx::NativeWindow window) { |
177 NOTIMPLEMENTED(); | 178 return window->GetBoundsInScreen().Contains(GetCursorScreenPoint()); |
sky
2016/05/02 23:01:43
I think you should check drawn here too.
| |
178 return nullptr; | |
179 } | 179 } |
180 | 180 |
181 gfx::NativeWindow ScreenMus::GetWindowAtScreenPoint(const gfx::Point& point) { | 181 gfx::NativeWindow ScreenMus::GetWindowAtScreenPoint(const gfx::Point& point) { |
182 NOTIMPLEMENTED(); | 182 NOTIMPLEMENTED(); |
183 return nullptr; | 183 return nullptr; |
184 } | 184 } |
185 | 185 |
186 display::Display ScreenMus::GetPrimaryDisplay() const { | 186 display::Display ScreenMus::GetPrimaryDisplay() const { |
187 return displays_[primary_display_index_]; | 187 return displays_[primary_display_index_]; |
188 } | 188 } |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
260 DCHECK_NE(-1, index); | 260 DCHECK_NE(-1, index); |
261 // Another display must become primary before the existing primary is | 261 // Another display must become primary before the existing primary is |
262 // removed. | 262 // removed. |
263 DCHECK_NE(index, primary_display_index_); | 263 DCHECK_NE(index, primary_display_index_); |
264 const display::Display display = displays_[index]; | 264 const display::Display display = displays_[index]; |
265 FOR_EACH_OBSERVER(display::DisplayObserver, observers_, | 265 FOR_EACH_OBSERVER(display::DisplayObserver, observers_, |
266 OnDisplayRemoved(display)); | 266 OnDisplayRemoved(display)); |
267 } | 267 } |
268 | 268 |
269 } // namespace views | 269 } // namespace views |
OLD | NEW |