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

Unified Diff: chrome/browser/ui/views/tabs/tab_drag_controller.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: fix new addition 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/tabs/tab_drag_controller.cc
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.cc b/chrome/browser/ui/views/tabs/tab_drag_controller.cc
index b1c1e17915c0cf99ea354d2fc6c0c55e3a5577d3..87511987fca82d7949263cf644ad85cd78462c85 100644
--- a/chrome/browser/ui/views/tabs/tab_drag_controller.cc
+++ b/chrome/browser/ui/views/tabs/tab_drag_controller.cc
@@ -404,6 +404,8 @@ void TabDragController::Init(
DCHECK(!tabs.empty());
DCHECK(std::find(tabs.begin(), tabs.end(), source_tab) != tabs.end());
source_tabstrip_ = source_tabstrip;
+ screen_ = gfx::Screen::GetScreenFor(
+ source_tabstrip->GetWidget()->GetNativeView());
source_tab_offset_ = source_tab_offset;
start_point_in_screen_ = gfx::Point(source_tab_offset, mouse_offset.y());
views::View::ConvertPointToScreen(source_tab, &start_point_in_screen_);
@@ -673,7 +675,7 @@ gfx::Point TabDragController::GetWindowCreatePoint(
// If the cursor is outside the monitor area, move it inside. For example,
// dropping a tab onto the task bar on Windows produces this situation.
- gfx::Rect work_area = gfx::Screen::GetDisplayNearestPoint(origin).work_area();
+ gfx::Rect work_area = screen_->GetDisplayNearestPoint(origin).work_area();
gfx::Point create_point(origin);
if (!work_area.IsEmpty()) {
if (create_point.x() < work_area.x())
@@ -1988,7 +1990,7 @@ gfx::Point TabDragController::GetCursorScreenPoint() {
return touch_point;
}
#endif
- return gfx::Screen::GetCursorScreenPoint();
+ return screen_->GetCursorScreenPoint();
}
gfx::Point TabDragController::GetWindowOffset(

Powered by Google App Engine
This is Rietveld 408576698