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

Side by Side Diff: chrome/browser/ui/views/tabs/tab_drag_controller2.cc

Issue 9960042: Refactor screen/monitor so that gfx::Screen returns monitor object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 8 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 "chrome/browser/ui/views/tabs/tab_drag_controller2.h" 5 #include "chrome/browser/ui/views/tabs/tab_drag_controller2.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <set> 8 #include <set>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 495
496 gfx::Point TabDragController2::GetWindowCreatePoint() const { 496 gfx::Point TabDragController2::GetWindowCreatePoint() const {
497 gfx::Point cursor_point = GetCursorScreenPoint(); 497 gfx::Point cursor_point = GetCursorScreenPoint();
498 if (dock_info_.type() != DockInfo::NONE && dock_info_.in_enable_area()) { 498 if (dock_info_.type() != DockInfo::NONE && dock_info_.in_enable_area()) {
499 // If we're going to dock, we need to return the exact coordinate, 499 // If we're going to dock, we need to return the exact coordinate,
500 // otherwise we may attempt to maximize on the wrong monitor. 500 // otherwise we may attempt to maximize on the wrong monitor.
501 return cursor_point; 501 return cursor_point;
502 } 502 }
503 // If the cursor is outside the monitor area, move it inside. For example, 503 // If the cursor is outside the monitor area, move it inside. For example,
504 // dropping a tab onto the task bar on Windows produces this situation. 504 // dropping a tab onto the task bar on Windows produces this situation.
505 gfx::Rect work_area = gfx::Screen::GetMonitorWorkAreaNearestPoint( 505 gfx::Rect work_area = gfx::Screen::GetMonitorNearestPoint(
506 cursor_point); 506 cursor_point).work_area();
507 if (!work_area.IsEmpty()) { 507 if (!work_area.IsEmpty()) {
508 if (cursor_point.x() < work_area.x()) 508 if (cursor_point.x() < work_area.x())
509 cursor_point.set_x(work_area.x()); 509 cursor_point.set_x(work_area.x());
510 else if (cursor_point.x() > work_area.right()) 510 else if (cursor_point.x() > work_area.right())
511 cursor_point.set_x(work_area.right()); 511 cursor_point.set_x(work_area.right());
512 if (cursor_point.y() < work_area.y()) 512 if (cursor_point.y() < work_area.y())
513 cursor_point.set_y(work_area.y()); 513 cursor_point.set_y(work_area.y());
514 else if (cursor_point.y() > work_area.bottom()) 514 else if (cursor_point.y() > work_area.bottom())
515 cursor_point.set_y(work_area.bottom()); 515 cursor_point.set_y(work_area.bottom());
516 } 516 }
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after
1427 browser->window()->SetBounds(new_bounds); 1427 browser->window()->SetBounds(new_bounds);
1428 return browser; 1428 return browser;
1429 } 1429 }
1430 1430
1431 void TabDragController2::SetTrackedByWorkspace(gfx::NativeWindow window, 1431 void TabDragController2::SetTrackedByWorkspace(gfx::NativeWindow window,
1432 bool value) { 1432 bool value) {
1433 #if defined(USE_ASH) 1433 #if defined(USE_ASH)
1434 ash::SetTrackedByWorkspace(window, value); 1434 ash::SetTrackedByWorkspace(window, value);
1435 #endif 1435 #endif
1436 } 1436 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698