| 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());
|
|
|