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 if (!window) |
178 return nullptr; | 179 return false; |
180 | |
181 return window->IsVisible() && | |
sky
2016/05/02 23:59:37
IsVisible->IsDrawn
sky
2016/05/03 00:02:48
D'OH. IsVisible is what you want. Sorry.
Elliot Glaysher
2016/05/03 00:13:19
As discussed in person, this is an aura window, no
| |
182 window->GetBoundsInScreen().Contains(GetCursorScreenPoint()); | |
179 } | 183 } |
180 | 184 |
181 gfx::NativeWindow ScreenMus::GetWindowAtScreenPoint(const gfx::Point& point) { | 185 gfx::NativeWindow ScreenMus::GetWindowAtScreenPoint(const gfx::Point& point) { |
182 NOTIMPLEMENTED(); | 186 NOTIMPLEMENTED(); |
183 return nullptr; | 187 return nullptr; |
184 } | 188 } |
185 | 189 |
186 display::Display ScreenMus::GetPrimaryDisplay() const { | 190 display::Display ScreenMus::GetPrimaryDisplay() const { |
187 return displays_[primary_display_index_]; | 191 return displays_[primary_display_index_]; |
188 } | 192 } |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
260 DCHECK_NE(-1, index); | 264 DCHECK_NE(-1, index); |
261 // Another display must become primary before the existing primary is | 265 // Another display must become primary before the existing primary is |
262 // removed. | 266 // removed. |
263 DCHECK_NE(index, primary_display_index_); | 267 DCHECK_NE(index, primary_display_index_); |
264 const display::Display display = displays_[index]; | 268 const display::Display display = displays_[index]; |
265 FOR_EACH_OBSERVER(display::DisplayObserver, observers_, | 269 FOR_EACH_OBSERVER(display::DisplayObserver, observers_, |
266 OnDisplayRemoved(display)); | 270 OnDisplayRemoved(display)); |
267 } | 271 } |
268 | 272 |
269 } // namespace views | 273 } // namespace views |
OLD | NEW |