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

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

Issue 16035005: Fix crash when quickly dragging a new tab. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after
1399 } 1399 }
1400 return GetTabAt(index); 1400 return GetTabAt(index);
1401 } 1401 }
1402 1402
1403 void TabStripGtk::RemoveTabAt(int index) { 1403 void TabStripGtk::RemoveTabAt(int index) {
1404 TabGtk* removed = tab_data_.at(index).tab; 1404 TabGtk* removed = tab_data_.at(index).tab;
1405 1405
1406 // Remove the Tab from the TabStrip's list. 1406 // Remove the Tab from the TabStrip's list.
1407 tab_data_.erase(tab_data_.begin() + index); 1407 tab_data_.erase(tab_data_.begin() + index);
1408 1408
1409 if (!IsDragSessionActive() || !drag_controller_->IsDraggingTab(removed)) { 1409 if (!removed->dragging()) {
1410 gtk_container_remove(GTK_CONTAINER(tabstrip_.get()), removed->widget()); 1410 gtk_container_remove(GTK_CONTAINER(tabstrip_.get()), removed->widget());
1411 delete removed; 1411 delete removed;
1412 } 1412 }
1413 } 1413 }
1414 1414
1415 void TabStripGtk::HandleGlobalMouseMoveEvent() { 1415 void TabStripGtk::HandleGlobalMouseMoveEvent() {
1416 if (!IsCursorInTabStripZone()) { 1416 if (!IsCursorInTabStripZone()) {
1417 // Mouse moved outside the tab slop zone, start a timer to do a resize 1417 // Mouse moved outside the tab slop zone, start a timer to do a resize
1418 // layout after a short while... 1418 // layout after a short while...
1419 if (!weak_factory_.HasWeakPtrs()) { 1419 if (!weak_factory_.HasWeakPtrs()) {
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
2272 2272
2273 void TabStripGtk::SetNewTabButtonBackground() { 2273 void TabStripGtk::SetNewTabButtonBackground() {
2274 SkColor color = theme_service_->GetColor( 2274 SkColor color = theme_service_->GetColor(
2275 ThemeProperties::COLOR_BUTTON_BACKGROUND); 2275 ThemeProperties::COLOR_BUTTON_BACKGROUND);
2276 SkBitmap background = theme_service_->GetImageNamed( 2276 SkBitmap background = theme_service_->GetImageNamed(
2277 IDR_THEME_WINDOW_CONTROL_BACKGROUND).AsBitmap(); 2277 IDR_THEME_WINDOW_CONTROL_BACKGROUND).AsBitmap();
2278 SkBitmap mask = theme_service_->GetImageNamed( 2278 SkBitmap mask = theme_service_->GetImageNamed(
2279 IDR_NEWTAB_BUTTON_MASK).AsBitmap(); 2279 IDR_NEWTAB_BUTTON_MASK).AsBitmap();
2280 newtab_button_->SetBackground(color, background, mask); 2280 newtab_button_->SetBackground(color, background, mask);
2281 } 2281 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698