Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: ash/display/screen_ash.cc

Issue 294073006: Remove dispatcher when shutting down RootWindowController (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 return GetDisplayManager()->displays(); 226 return GetDisplayManager()->displays();
227 } 227 }
228 228
229 gfx::Display ScreenAsh::GetDisplayNearestWindow(gfx::NativeView window) const { 229 gfx::Display ScreenAsh::GetDisplayNearestWindow(gfx::NativeView window) const {
230 if (!window) 230 if (!window)
231 return GetPrimaryDisplay(); 231 return GetPrimaryDisplay();
232 const aura::Window* root_window = window->GetRootWindow(); 232 const aura::Window* root_window = window->GetRootWindow();
233 if (!root_window) 233 if (!root_window)
234 return GetPrimaryDisplay(); 234 return GetPrimaryDisplay();
235 const RootWindowSettings* rws = GetRootWindowSettings(root_window); 235 const RootWindowSettings* rws = GetRootWindowSettings(root_window);
236 if (rws->shutdown)
237 return GetPrimaryDisplay();
238
239 int64 id = rws->display_id; 236 int64 id = rws->display_id;
240 // if id is |kInvaildDisplayID|, it's being deleted. 237 // if id is |kInvaildDisplayID|, it's being deleted.
241 DCHECK(id != gfx::Display::kInvalidDisplayID); 238 DCHECK(id != gfx::Display::kInvalidDisplayID);
239 if (id != gfx::Display::kInvalidDisplayID)
sadrul 2014/05/21 19:01:49 Did you mean id == invalid here?
oshima 2014/05/22 17:03:13 oops, fixed. thanks.
240 return GetPrimaryDisplay();
242 241
243 DisplayManager* display_manager = GetDisplayManager(); 242 DisplayManager* display_manager = GetDisplayManager();
244 // RootWindow needs Display to determine its device scale factor 243 // RootWindow needs Display to determine its device scale factor
245 // for non desktop display. 244 // for non desktop display.
246 if (display_manager->non_desktop_display().id() == id) 245 if (display_manager->non_desktop_display().id() == id)
247 return display_manager->non_desktop_display(); 246 return display_manager->non_desktop_display();
248 return display_manager->GetDisplayForId(id); 247 return display_manager->GetDisplayForId(id);
249 } 248 }
250 249
251 gfx::Display ScreenAsh::GetDisplayNearestPoint(const gfx::Point& point) const { 250 gfx::Display ScreenAsh::GetDisplayNearestPoint(const gfx::Point& point) const {
(...skipping 27 matching lines...) Expand all
279 278
280 void ScreenAsh::RemoveObserver(gfx::DisplayObserver* observer) { 279 void ScreenAsh::RemoveObserver(gfx::DisplayObserver* observer) {
281 observers_.RemoveObserver(observer); 280 observers_.RemoveObserver(observer);
282 } 281 }
283 282
284 gfx::Screen* ScreenAsh::CloneForShutdown() { 283 gfx::Screen* ScreenAsh::CloneForShutdown() {
285 return new ScreenForShutdown(this); 284 return new ScreenForShutdown(this);
286 } 285 }
287 286
288 } // namespace ash 287 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698