| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/gtk/tabs/tab_strip_gtk.h" | 5 #include "chrome/browser/gtk/tabs/tab_strip_gtk.h" |
| 6 | 6 |
| 7 #include "base/gfx/gtk_util.h" | 7 #include "base/gfx/gtk_util.h" |
| 8 #include "base/gfx/point.h" | 8 #include "base/gfx/point.h" |
| 9 #include "chrome/browser/browser.h" | 9 #include "chrome/browser/browser.h" |
| 10 #include "chrome/browser/tab_contents/tab_contents.h" | 10 #include "chrome/browser/tab_contents/tab_contents.h" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 int to_index) { | 155 int to_index) { |
| 156 TabGtk* tab = GetTabAt(from_index); | 156 TabGtk* tab = GetTabAt(from_index); |
| 157 tab_data_.erase(tab_data_.begin() + from_index); | 157 tab_data_.erase(tab_data_.begin() + from_index); |
| 158 TabData data = {tab, gfx::Rect()}; | 158 TabData data = {tab, gfx::Rect()}; |
| 159 tab_data_.insert(tab_data_.begin() + to_index, data); | 159 tab_data_.insert(tab_data_.begin() + to_index, data); |
| 160 GenerateIdealBounds(); | 160 GenerateIdealBounds(); |
| 161 // TODO(jhawkins): Remove layout call when animations are hooked up. | 161 // TODO(jhawkins): Remove layout call when animations are hooked up. |
| 162 Layout(); | 162 Layout(); |
| 163 } | 163 } |
| 164 | 164 |
| 165 void TabStripGtk::TabChangedAt(TabContents* contents, int index) { | 165 void TabStripGtk::TabChangedAt(TabContents* contents, int index, |
| 166 bool loading_only) { |
| 166 // Index is in terms of the model. Need to make sure we adjust that index in | 167 // Index is in terms of the model. Need to make sure we adjust that index in |
| 167 // case we have an animation going. | 168 // case we have an animation going. |
| 168 TabGtk* tab = GetTabAt(index); | 169 TabGtk* tab = GetTabAt(index); |
| 169 tab->UpdateData(contents); | 170 tab->UpdateData(contents); |
| 170 tab->UpdateFromModel(); | 171 tab->UpdateFromModel(); |
| 171 gtk_widget_queue_draw(tabstrip_.get()); | 172 gtk_widget_queue_draw(tabstrip_.get()); |
| 172 } | 173 } |
| 173 | 174 |
| 174 /////////////////////////////////////////////////////////////////////////////// | 175 /////////////////////////////////////////////////////////////////////////////// |
| 175 // TabStripGtk, TabGtk::Delegate implementation: | 176 // TabStripGtk, TabGtk::Delegate implementation: |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 // static | 480 // static |
| 480 gboolean TabStripGtk::OnButtonPress(GtkWidget* widget, GdkEventButton* event, | 481 gboolean TabStripGtk::OnButtonPress(GtkWidget* widget, GdkEventButton* event, |
| 481 TabStripGtk* tabstrip) { | 482 TabStripGtk* tabstrip) { |
| 482 if (tabstrip->hover_index_ != -1 && | 483 if (tabstrip->hover_index_ != -1 && |
| 483 tabstrip->hover_index_ != tabstrip->model()->selected_index()) { | 484 tabstrip->hover_index_ != tabstrip->model()->selected_index()) { |
| 484 tabstrip->model()->SelectTabContentsAt(tabstrip->hover_index_, true); | 485 tabstrip->model()->SelectTabContentsAt(tabstrip->hover_index_, true); |
| 485 } | 486 } |
| 486 | 487 |
| 487 return TRUE; | 488 return TRUE; |
| 488 } | 489 } |
| OLD | NEW |