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

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

Issue 10692195: Consolidate Browser Creation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 1862 matching lines...) Expand 10 before | Expand all | Expand 10 after
1873 return false; 1873 return false;
1874 } 1874 }
1875 } 1875 }
1876 return true; 1876 return true;
1877 } 1877 }
1878 1878
1879 Browser* TabDragController::CreateBrowserForDrag( 1879 Browser* TabDragController::CreateBrowserForDrag(
1880 TabStrip* source, 1880 TabStrip* source,
1881 const gfx::Point& screen_point, 1881 const gfx::Point& screen_point,
1882 std::vector<gfx::Rect>* drag_bounds) { 1882 std::vector<gfx::Rect>* drag_bounds) {
1883 Browser* browser = Browser::Create(drag_data_[0].contents->profile()); 1883 Browser* browser = new Browser(
1884 Browser::CreateParams(drag_data_[0].contents->profile()));
1884 gfx::Point center(0, source->height() / 2); 1885 gfx::Point center(0, source->height() / 2);
1885 views::View::ConvertPointToWidget(source, &center); 1886 views::View::ConvertPointToWidget(source, &center);
1886 gfx::Rect new_bounds(source->GetWidget()->GetWindowBoundsInScreen()); 1887 gfx::Rect new_bounds(source->GetWidget()->GetWindowBoundsInScreen());
1887 new_bounds.set_y(screen_point.y() - center.y()); 1888 new_bounds.set_y(screen_point.y() - center.y());
1888 switch (GetDetachPosition(screen_point)) { 1889 switch (GetDetachPosition(screen_point)) {
1889 case DETACH_BEFORE: 1890 case DETACH_BEFORE:
1890 new_bounds.set_x(screen_point.x() - center.x()); 1891 new_bounds.set_x(screen_point.x() - center.x());
1891 new_bounds.Offset(-mouse_offset_.x(), 0); 1892 new_bounds.Offset(-mouse_offset_.x(), 0);
1892 break; 1893 break;
1893 1894
(...skipping 27 matching lines...) Expand all
1921 gfx::Point touch_point; 1922 gfx::Point touch_point;
1922 bool got_touch_point = widget_window->GetRootWindow()-> 1923 bool got_touch_point = widget_window->GetRootWindow()->
1923 gesture_recognizer()->GetLastTouchPointForTarget(widget_window, 1924 gesture_recognizer()->GetLastTouchPointForTarget(widget_window,
1924 &touch_point); 1925 &touch_point);
1925 DCHECK(got_touch_point); 1926 DCHECK(got_touch_point);
1926 return touch_point; 1927 return touch_point;
1927 } 1928 }
1928 #endif 1929 #endif
1929 return gfx::Screen::GetCursorScreenPoint(); 1930 return gfx::Screen::GetCursorScreenPoint();
1930 } 1931 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698