OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ash/display/screen_ash.h" | 5 #include "ash/display/screen_ash.h" |
6 | 6 |
7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
10 #include "ash/root_window_settings.h" | 10 #include "ash/root_window_settings.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 } | 64 } |
65 | 65 |
66 class ScreenForShutdown : public gfx::Screen { | 66 class ScreenForShutdown : public gfx::Screen { |
67 public: | 67 public: |
68 explicit ScreenForShutdown(ScreenAsh* screen_ash) | 68 explicit ScreenForShutdown(ScreenAsh* screen_ash) |
69 : display_list_(screen_ash->GetAllDisplays()), | 69 : display_list_(screen_ash->GetAllDisplays()), |
70 primary_display_(screen_ash->GetPrimaryDisplay()) { | 70 primary_display_(screen_ash->GetPrimaryDisplay()) { |
71 } | 71 } |
72 | 72 |
73 // gfx::Screen overrides: | 73 // gfx::Screen overrides: |
74 virtual bool IsDIPEnabled() override { | |
75 return true; | |
76 } | |
77 virtual gfx::Point GetCursorScreenPoint() override { | 74 virtual gfx::Point GetCursorScreenPoint() override { |
78 return gfx::Point(); | 75 return gfx::Point(); |
79 } | 76 } |
80 virtual gfx::NativeWindow GetWindowUnderCursor() override { | 77 virtual gfx::NativeWindow GetWindowUnderCursor() override { |
81 return NULL; | 78 return NULL; |
82 } | 79 } |
83 virtual gfx::NativeWindow GetWindowAtScreenPoint( | 80 virtual gfx::NativeWindow GetWindowAtScreenPoint( |
84 const gfx::Point& point) override { | 81 const gfx::Point& point) override { |
85 return NULL; | 82 return NULL; |
86 } | 83 } |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 194 |
198 void ScreenAsh::NotifyDisplayAdded(const gfx::Display& display) { | 195 void ScreenAsh::NotifyDisplayAdded(const gfx::Display& display) { |
199 FOR_EACH_OBSERVER(gfx::DisplayObserver, observers_, OnDisplayAdded(display)); | 196 FOR_EACH_OBSERVER(gfx::DisplayObserver, observers_, OnDisplayAdded(display)); |
200 } | 197 } |
201 | 198 |
202 void ScreenAsh::NotifyDisplayRemoved(const gfx::Display& display) { | 199 void ScreenAsh::NotifyDisplayRemoved(const gfx::Display& display) { |
203 FOR_EACH_OBSERVER( | 200 FOR_EACH_OBSERVER( |
204 gfx::DisplayObserver, observers_, OnDisplayRemoved(display)); | 201 gfx::DisplayObserver, observers_, OnDisplayRemoved(display)); |
205 } | 202 } |
206 | 203 |
207 bool ScreenAsh::IsDIPEnabled() { | |
208 return true; | |
209 } | |
210 | |
211 gfx::Point ScreenAsh::GetCursorScreenPoint() { | 204 gfx::Point ScreenAsh::GetCursorScreenPoint() { |
212 return aura::Env::GetInstance()->last_mouse_location(); | 205 return aura::Env::GetInstance()->last_mouse_location(); |
213 } | 206 } |
214 | 207 |
215 gfx::NativeWindow ScreenAsh::GetWindowUnderCursor() { | 208 gfx::NativeWindow ScreenAsh::GetWindowUnderCursor() { |
216 return GetWindowAtScreenPoint(Shell::GetScreen()->GetCursorScreenPoint()); | 209 return GetWindowAtScreenPoint(Shell::GetScreen()->GetCursorScreenPoint()); |
217 } | 210 } |
218 | 211 |
219 gfx::NativeWindow ScreenAsh::GetWindowAtScreenPoint(const gfx::Point& point) { | 212 gfx::NativeWindow ScreenAsh::GetWindowAtScreenPoint(const gfx::Point& point) { |
220 return wm::GetRootWindowAt(point)->GetTopWindowContainingPoint(point); | 213 return wm::GetRootWindowAt(point)->GetTopWindowContainingPoint(point); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 273 |
281 void ScreenAsh::RemoveObserver(gfx::DisplayObserver* observer) { | 274 void ScreenAsh::RemoveObserver(gfx::DisplayObserver* observer) { |
282 observers_.RemoveObserver(observer); | 275 observers_.RemoveObserver(observer); |
283 } | 276 } |
284 | 277 |
285 gfx::Screen* ScreenAsh::CloneForShutdown() { | 278 gfx::Screen* ScreenAsh::CloneForShutdown() { |
286 return new ScreenForShutdown(this); | 279 return new ScreenForShutdown(this); |
287 } | 280 } |
288 | 281 |
289 } // namespace ash | 282 } // namespace ash |
OLD | NEW |