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

Side by Side Diff: chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc

Issue 17382005: Unbreak tabs.onRemove extension API in face of fast tab closure Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't modify content Created 7 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 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/gtk/tabs/tab_strip_gtk.h" 5 #include "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 // if GTK paints before the animation event the tab is painted at 0x0 1035 // if GTK paints before the animation event the tab is painted at 0x0
1036 // which is most likely not where it should be positioned. 1036 // which is most likely not where it should be positioned.
1037 active_animation_->AnimationProgressed(NULL); 1037 active_animation_->AnimationProgressed(NULL);
1038 } else { 1038 } else {
1039 Layout(); 1039 Layout();
1040 } 1040 }
1041 1041
1042 ReStack(); 1042 ReStack();
1043 } 1043 }
1044 1044
1045 void TabStripGtk::TabDetachedAt(WebContents* contents, int index) { 1045 void TabStripGtk::TabDetachedAt(WebContents* contents,
1046 int index,
1047 bool closing_all) {
1046 GenerateIdealBounds(); 1048 GenerateIdealBounds();
1047 StartRemoveTabAnimation(index, contents); 1049 StartRemoveTabAnimation(index, contents);
1048 // Have to do this _after_ calling StartRemoveTabAnimation, so that any 1050 // Have to do this _after_ calling StartRemoveTabAnimation, so that any
1049 // previous remove is completed fully and index is valid in sync with the 1051 // previous remove is completed fully and index is valid in sync with the
1050 // model index. 1052 // model index.
1051 GetTabAt(index)->set_closing(true); 1053 GetTabAt(index)->set_closing(true);
1052 } 1054 }
1053 1055
1054 void TabStripGtk::ActiveTabChanged(WebContents* old_contents, 1056 void TabStripGtk::ActiveTabChanged(WebContents* old_contents,
1055 WebContents* new_contents, 1057 WebContents* new_contents,
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after
2272 2274
2273 void TabStripGtk::SetNewTabButtonBackground() { 2275 void TabStripGtk::SetNewTabButtonBackground() {
2274 SkColor color = theme_service_->GetColor( 2276 SkColor color = theme_service_->GetColor(
2275 ThemeProperties::COLOR_BUTTON_BACKGROUND); 2277 ThemeProperties::COLOR_BUTTON_BACKGROUND);
2276 SkBitmap background = theme_service_->GetImageNamed( 2278 SkBitmap background = theme_service_->GetImageNamed(
2277 IDR_THEME_WINDOW_CONTROL_BACKGROUND).AsBitmap(); 2279 IDR_THEME_WINDOW_CONTROL_BACKGROUND).AsBitmap();
2278 SkBitmap mask = theme_service_->GetImageNamed( 2280 SkBitmap mask = theme_service_->GetImageNamed(
2279 IDR_NEWTAB_BUTTON_MASK).AsBitmap(); 2281 IDR_NEWTAB_BUTTON_MASK).AsBitmap();
2280 newtab_button_->SetBackground(color, background, mask); 2282 newtab_button_->SetBackground(color, background, mask);
2281 } 2283 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698