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

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

Issue 6462022: It turns out I had the sense of the GetLocalBounds bool wrong everywhere, so ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 10 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/dragged_tab_controller.h" 5 #include "chrome/browser/ui/views/tabs/dragged_tab_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 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after
1261 #else 1261 #else
1262 gint x, y; 1262 gint x, y;
1263 gdk_display_get_pointer(gdk_display_get_default(), NULL, &x, &y, NULL); 1263 gdk_display_get_pointer(gdk_display_get_default(), NULL, &x, &y, NULL);
1264 return gfx::Point(x, y); 1264 return gfx::Point(x, y);
1265 #endif 1265 #endif
1266 } 1266 }
1267 1267
1268 gfx::Rect DraggedTabController::GetViewScreenBounds(views::View* view) const { 1268 gfx::Rect DraggedTabController::GetViewScreenBounds(views::View* view) const {
1269 gfx::Point view_topleft; 1269 gfx::Point view_topleft;
1270 views::View::ConvertPointToScreen(view, &view_topleft); 1270 views::View::ConvertPointToScreen(view, &view_topleft);
1271 gfx::Rect view_screen_bounds = view->GetContentsBounds(); 1271 gfx::Rect view_screen_bounds = view->GetLocalBounds();
1272 view_screen_bounds.Offset(view_topleft.x(), view_topleft.y()); 1272 view_screen_bounds.Offset(view_topleft.x(), view_topleft.y());
1273 return view_screen_bounds; 1273 return view_screen_bounds;
1274 } 1274 }
1275 1275
1276 int DraggedTabController::NormalizeIndexToAttachedTabStrip(int index) const { 1276 int DraggedTabController::NormalizeIndexToAttachedTabStrip(int index) const {
1277 DCHECK(attached_tabstrip_) << "Can only be called when attached!"; 1277 DCHECK(attached_tabstrip_) << "Can only be called when attached!";
1278 TabStripModel* attached_model = GetModel(attached_tabstrip_); 1278 TabStripModel* attached_model = GetModel(attached_tabstrip_);
1279 if (index >= attached_model->count()) 1279 if (index >= attached_model->count())
1280 return attached_model->count() - 1; 1280 return attached_model->count() - 1;
1281 if (index == TabStripModel::kNoTab) 1281 if (index == TabStripModel::kNoTab)
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
1349 #else 1349 #else
1350 NOTIMPLEMENTED(); 1350 NOTIMPLEMENTED();
1351 #endif 1351 #endif
1352 } 1352 }
1353 } 1353 }
1354 1354
1355 TabStripModel* DraggedTabController::GetModel(BaseTabStrip* tabstrip) const { 1355 TabStripModel* DraggedTabController::GetModel(BaseTabStrip* tabstrip) const {
1356 return static_cast<BrowserTabStripController*>(tabstrip->controller())-> 1356 return static_cast<BrowserTabStripController*>(tabstrip->controller())->
1357 model(); 1357 model();
1358 } 1358 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698