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

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

Issue 10795013: Rename bounds accessors to be intuitive and consistent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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_controller.h" 5 #include "chrome/browser/ui/views/tabs/tab_drag_controller.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 1853 matching lines...) Expand 10 before | Expand all | Expand 10 after
1864 return true; 1864 return true;
1865 } 1865 }
1866 1866
1867 Browser* TabDragController::CreateBrowserForDrag( 1867 Browser* TabDragController::CreateBrowserForDrag(
1868 TabStrip* source, 1868 TabStrip* source,
1869 const gfx::Point& screen_point, 1869 const gfx::Point& screen_point,
1870 std::vector<gfx::Rect>* drag_bounds) { 1870 std::vector<gfx::Rect>* drag_bounds) {
1871 Browser* browser = Browser::Create(drag_data_[0].contents->profile()); 1871 Browser* browser = Browser::Create(drag_data_[0].contents->profile());
1872 gfx::Point center(0, source->height() / 2); 1872 gfx::Point center(0, source->height() / 2);
1873 views::View::ConvertPointToWidget(source, &center); 1873 views::View::ConvertPointToWidget(source, &center);
1874 gfx::Rect new_bounds(source->GetWidget()->GetWindowScreenBounds()); 1874 gfx::Rect new_bounds(source->GetWidget()->GetWindowBoundsInScreen());
1875 new_bounds.set_y(screen_point.y() - center.y()); 1875 new_bounds.set_y(screen_point.y() - center.y());
1876 switch (GetDetachPosition(screen_point)) { 1876 switch (GetDetachPosition(screen_point)) {
1877 case DETACH_BEFORE: 1877 case DETACH_BEFORE:
1878 new_bounds.set_x(screen_point.x() - center.x()); 1878 new_bounds.set_x(screen_point.x() - center.x());
1879 new_bounds.Offset(-mouse_offset_.x(), 0); 1879 new_bounds.Offset(-mouse_offset_.x(), 0);
1880 break; 1880 break;
1881 1881
1882 case DETACH_AFTER: { 1882 case DETACH_AFTER: {
1883 gfx::Point right_edge(source->width(), 0); 1883 gfx::Point right_edge(source->width(), 0);
1884 views::View::ConvertPointToWidget(source, &right_edge); 1884 views::View::ConvertPointToWidget(source, &right_edge);
(...skipping 24 matching lines...) Expand all
1909 gfx::Point touch_point; 1909 gfx::Point touch_point;
1910 bool got_touch_point = widget_window->GetRootWindow()-> 1910 bool got_touch_point = widget_window->GetRootWindow()->
1911 gesture_recognizer()->GetLastTouchPointForTarget(widget_window, 1911 gesture_recognizer()->GetLastTouchPointForTarget(widget_window,
1912 &touch_point); 1912 &touch_point);
1913 DCHECK(got_touch_point); 1913 DCHECK(got_touch_point);
1914 return touch_point; 1914 return touch_point;
1915 } 1915 }
1916 #endif 1916 #endif
1917 return gfx::Screen::GetCursorScreenPoint(); 1917 return gfx::Screen::GetCursorScreenPoint();
1918 } 1918 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/dragged_tab_view.cc ('k') | chrome/browser/ui/views/web_dialog_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698