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

Side by Side Diff: ash/screen_ash.cc

Issue 11030017: Add context to gfx::Screen calls in support of simultaneous desktop+ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tidy Created 8 years, 2 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/screen_ash.h" 5 #include "ash/screen_ash.h"
6 6
7 #include "ash/display/display_controller.h" 7 #include "ash/display/display_controller.h"
8 #include "ash/display/multi_display_manager.h" 8 #include "ash/display/multi_display_manager.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/wm/coordinate_conversion.h" 10 #include "ash/wm/coordinate_conversion.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // static 89 // static
90 const gfx::Display& ScreenAsh::GetSecondaryDisplay() { 90 const gfx::Display& ScreenAsh::GetSecondaryDisplay() {
91 return *(Shell::GetInstance()->display_controller()->GetSecondaryDisplay()); 91 return *(Shell::GetInstance()->display_controller()->GetSecondaryDisplay());
92 } 92 }
93 93
94 gfx::Point ScreenAsh::GetCursorScreenPoint() { 94 gfx::Point ScreenAsh::GetCursorScreenPoint() {
95 return aura::Env::GetInstance()->last_mouse_location(); 95 return aura::Env::GetInstance()->last_mouse_location();
96 } 96 }
97 97
98 gfx::NativeWindow ScreenAsh::GetWindowAtCursorScreenPoint() { 98 gfx::NativeWindow ScreenAsh::GetWindowAtCursorScreenPoint() {
99 const gfx::Point point = gfx::Screen::GetCursorScreenPoint(); 99 const gfx::Point point = gfx::Screen::GetCursorScreenPoint(
100 ash::Shell::GetRootNativeView());
100 return wm::GetRootWindowAt(point)->GetTopWindowContainingPoint(point); 101 return wm::GetRootWindowAt(point)->GetTopWindowContainingPoint(point);
101 } 102 }
102 103
103 int ScreenAsh::GetNumDisplays() { 104 int ScreenAsh::GetNumDisplays() {
104 return GetDisplayManager()->GetNumDisplays(); 105 return GetDisplayManager()->GetNumDisplays();
105 } 106 }
106 107
107 gfx::Display ScreenAsh::GetDisplayNearestWindow(gfx::NativeView window) const { 108 gfx::Display ScreenAsh::GetDisplayNearestWindow(gfx::NativeView window) const {
108 return GetDisplayManager()->GetDisplayNearestWindow(window); 109 return GetDisplayManager()->GetDisplayNearestWindow(window);
109 } 110 }
110 111
111 gfx::Display ScreenAsh::GetDisplayNearestPoint(const gfx::Point& point) const { 112 gfx::Display ScreenAsh::GetDisplayNearestPoint(const gfx::Point& point) const {
112 return GetDisplayManager()->GetDisplayNearestPoint(point); 113 return GetDisplayManager()->GetDisplayNearestPoint(point);
113 } 114 }
114 115
115 gfx::Display ScreenAsh::GetDisplayMatching(const gfx::Rect& match_rect) const { 116 gfx::Display ScreenAsh::GetDisplayMatching(const gfx::Rect& match_rect) const {
116 return GetDisplayManager()->GetDisplayMatching(match_rect); 117 return GetDisplayManager()->GetDisplayMatching(match_rect);
117 } 118 }
118 119
119 gfx::Display ScreenAsh::GetPrimaryDisplay() const { 120 gfx::Display ScreenAsh::GetPrimaryDisplay() const {
120 return DisplayController::GetPrimaryDisplay(); 121 return DisplayController::GetPrimaryDisplay();
121 } 122 }
122 123
123 } // namespace ash 124 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698