| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 return GetDisplayManager()->active_display_list(); | 123 return GetDisplayManager()->active_display_list(); |
| 124 } | 124 } |
| 125 | 125 |
| 126 gfx::Display ScreenAsh::GetDisplayNearestWindow(gfx::NativeView window) const { | 126 gfx::Display ScreenAsh::GetDisplayNearestWindow(gfx::NativeView window) const { |
| 127 if (!window) | 127 if (!window) |
| 128 return GetPrimaryDisplay(); | 128 return GetPrimaryDisplay(); |
| 129 const aura::Window* root_window = window->GetRootWindow(); | 129 const aura::Window* root_window = window->GetRootWindow(); |
| 130 if (!root_window) | 130 if (!root_window) |
| 131 return GetPrimaryDisplay(); | 131 return GetPrimaryDisplay(); |
| 132 const RootWindowSettings* rws = GetRootWindowSettings(root_window); | 132 const RootWindowSettings* rws = GetRootWindowSettings(root_window); |
| 133 if (!rws) |
| 134 return GetPrimaryDisplay(); |
| 133 int64_t id = rws->display_id; | 135 int64_t id = rws->display_id; |
| 134 // if id is |kInvaildDisplayID|, it's being deleted. | 136 // if id is |kInvaildDisplayID|, it's being deleted. |
| 135 DCHECK(id != gfx::Display::kInvalidDisplayID); | 137 DCHECK(id != gfx::Display::kInvalidDisplayID); |
| 136 if (id == gfx::Display::kInvalidDisplayID) | 138 if (id == gfx::Display::kInvalidDisplayID) |
| 137 return GetPrimaryDisplay(); | 139 return GetPrimaryDisplay(); |
| 138 | 140 |
| 139 DisplayManager* display_manager = GetDisplayManager(); | 141 DisplayManager* display_manager = GetDisplayManager(); |
| 140 // RootWindow needs Display to determine its device scale factor | 142 // RootWindow needs Display to determine its device scale factor |
| 141 // for non desktop display. | 143 // for non desktop display. |
| 142 gfx::Display mirroring_display = display_manager->GetMirroringDisplayById(id); | 144 gfx::Display mirroring_display = display_manager->GetMirroringDisplayById(id); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 179 |
| 178 void ScreenAsh::RemoveObserver(gfx::DisplayObserver* observer) { | 180 void ScreenAsh::RemoveObserver(gfx::DisplayObserver* observer) { |
| 179 observers_.RemoveObserver(observer); | 181 observers_.RemoveObserver(observer); |
| 180 } | 182 } |
| 181 | 183 |
| 182 gfx::Screen* ScreenAsh::CloneForShutdown() { | 184 gfx::Screen* ScreenAsh::CloneForShutdown() { |
| 183 return new ScreenForShutdown(this); | 185 return new ScreenForShutdown(this); |
| 184 } | 186 } |
| 185 | 187 |
| 186 } // namespace ash | 188 } // namespace ash |
| OLD | NEW |