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_manager.h" | 7 #include "ash/display/display_manager.h" |
8 #include "ash/display/window_tree_host_manager.h" | 8 #include "ash/display/window_tree_host_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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 return GetDisplayManager()->active_display_list(); | 157 return GetDisplayManager()->active_display_list(); |
158 } | 158 } |
159 | 159 |
160 gfx::Display ScreenAsh::GetDisplayNearestWindow(gfx::NativeView window) const { | 160 gfx::Display ScreenAsh::GetDisplayNearestWindow(gfx::NativeView window) const { |
161 if (!window) | 161 if (!window) |
162 return GetPrimaryDisplay(); | 162 return GetPrimaryDisplay(); |
163 const aura::Window* root_window = window->GetRootWindow(); | 163 const aura::Window* root_window = window->GetRootWindow(); |
164 if (!root_window) | 164 if (!root_window) |
165 return GetPrimaryDisplay(); | 165 return GetPrimaryDisplay(); |
166 const RootWindowSettings* rws = GetRootWindowSettings(root_window); | 166 const RootWindowSettings* rws = GetRootWindowSettings(root_window); |
167 int64 id = rws->display_id; | 167 int64_t id = rws->display_id; |
168 // if id is |kInvaildDisplayID|, it's being deleted. | 168 // if id is |kInvaildDisplayID|, it's being deleted. |
169 DCHECK(id != gfx::Display::kInvalidDisplayID); | 169 DCHECK(id != gfx::Display::kInvalidDisplayID); |
170 if (id == gfx::Display::kInvalidDisplayID) | 170 if (id == gfx::Display::kInvalidDisplayID) |
171 return GetPrimaryDisplay(); | 171 return GetPrimaryDisplay(); |
172 | 172 |
173 DisplayManager* display_manager = GetDisplayManager(); | 173 DisplayManager* display_manager = GetDisplayManager(); |
174 // RootWindow needs Display to determine its device scale factor | 174 // RootWindow needs Display to determine its device scale factor |
175 // for non desktop display. | 175 // for non desktop display. |
176 gfx::Display mirroring_display = display_manager->GetMirroringDisplayById(id); | 176 gfx::Display mirroring_display = display_manager->GetMirroringDisplayById(id); |
177 if (mirroring_display.is_valid()) | 177 if (mirroring_display.is_valid()) |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 211 |
212 void ScreenAsh::RemoveObserver(gfx::DisplayObserver* observer) { | 212 void ScreenAsh::RemoveObserver(gfx::DisplayObserver* observer) { |
213 observers_.RemoveObserver(observer); | 213 observers_.RemoveObserver(observer); |
214 } | 214 } |
215 | 215 |
216 gfx::Screen* ScreenAsh::CloneForShutdown() { | 216 gfx::Screen* ScreenAsh::CloneForShutdown() { |
217 return new ScreenForShutdown(this); | 217 return new ScreenForShutdown(this); |
218 } | 218 } |
219 | 219 |
220 } // namespace ash | 220 } // namespace ash |
OLD | NEW |