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

Unified Diff: chrome/browser/ui/views/tabs/tab_strip.cc

Issue 7044061: Fixes bug where closing a pinned tab followed by dragging a tab could (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 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
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/tab_strip.cc
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index 990bcecac37ce35856924931ab33f5bf3c77332b..38aaf32cf860959529768c84197f5e5f6bef5d2d 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -214,8 +214,14 @@ void TabStrip::PrepareForCloseAt(int model_index) {
// available_width_for_tabs_ so that if we do a layout we don't position a
// tab past the end of the second to last tab. We do this so that as the
// user closes tabs with the mouse a tab continues to fall under the mouse.
- available_width_for_tabs_ = GetAvailableWidthForTabs(
- GetTabAtModelIndex(model_count - 2));
+ Tab* last_tab = GetTabAtModelIndex(model_count - 1);
+ Tab* tab_being_removed = GetTabAtModelIndex(model_index);
+ available_width_for_tabs_ = last_tab->x() + last_tab->width() -
+ tab_being_removed->width() - kTabHOffset;
+ if (model_index == 0 && tab_being_removed->data().mini &&
+ !GetTabAtModelIndex(1)->data().mini) {
+ available_width_for_tabs_ -= mini_to_non_mini_gap_;
+ }
}
in_tab_close_ = true;
@@ -996,10 +1002,6 @@ int TabStrip::GetMiniTabCount() const {
return mini_count;
}
-int TabStrip::GetAvailableWidthForTabs(Tab* last_tab) const {
- return last_tab->x() + last_tab->width();
-}
-
bool TabStrip::IsPointInTab(Tab* tab,
const gfx::Point& point_in_tabstrip_coords) {
gfx::Point point_in_tab_coords(point_in_tabstrip_coords);
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698