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

Unified Diff: chrome/browser/gtk/tabs/tab_strip_gtk.cc

Issue 62133: Fix a crash on tab closure. We now use our own model data and check that the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/tabs/tab_strip_gtk.cc
===================================================================
--- chrome/browser/gtk/tabs/tab_strip_gtk.cc (revision 13189)
+++ chrome/browser/gtk/tabs/tab_strip_gtk.cc (working copy)
@@ -435,8 +435,9 @@
// Get a rough estimate for which tab the mouse is over.
int index = event->x / (tabstrip->current_unselected_width_ + kTabHOffset);
- if (index >= tabstrip->model_->count()) {
- if (old_hover_index != -1) {
+ int tab_count = tabstrip->GetTabCount();
+ if (index >= tab_count) {
+ if (old_hover_index != -1 && old_hover_index < tab_count) {
tabstrip->GetTabAt(old_hover_index)->SetHovering(false);
gtk_widget_queue_draw(tabstrip->tabstrip_.get());
}
@@ -460,7 +461,7 @@
} else if (tabstrip->model()->selected_index() != index &&
tabstrip->GetTabAt(index)->IsPointInBounds(coord)) {
tabstrip->hover_index_ = index;
- } else if (index < tabstrip->model_->count() - 1 &&
+ } else if (index < tab_count - 1 &&
tabstrip->GetTabAt(index + 1)->IsPointInBounds(coord)) {
tabstrip->hover_index_ = index + 1;
}
@@ -470,7 +471,7 @@
if (tabstrip->hover_index_ != -1)
tabstrip->GetTabAt(tabstrip->hover_index_)->SetHovering(true);
- if (old_hover_index != -1)
+ if (old_hover_index != -1 && old_hover_index < tab_count)
tabstrip->GetTabAt(old_hover_index)->SetHovering(false);
gtk_widget_queue_draw(tabstrip->tabstrip_.get());
« 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