| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/tabs/tab_strip.h" | 5 #include "chrome/browser/views/tabs/tab_strip.h" |
| 6 | 6 |
| 7 #include "app/animation_container.h" | 7 #include "app/animation_container.h" |
| 8 #include "app/drag_drop_types.h" | 8 #include "app/drag_drop_types.h" |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 // We have "tiny tabs" if the tabs are so tiny that the unselected ones are | 285 // We have "tiny tabs" if the tabs are so tiny that the unselected ones are |
| 286 // a different size to the selected ones. | 286 // a different size to the selected ones. |
| 287 bool tiny_tabs = current_unselected_width_ != current_selected_width_; | 287 bool tiny_tabs = current_unselected_width_ != current_selected_width_; |
| 288 if (!IsAnimating() && (!in_tab_close_ || tiny_tabs)) { | 288 if (!IsAnimating() && (!in_tab_close_ || tiny_tabs)) { |
| 289 Layout(); | 289 Layout(); |
| 290 } else { | 290 } else { |
| 291 SchedulePaint(); | 291 SchedulePaint(); |
| 292 } | 292 } |
| 293 | 293 |
| 294 if (old_model_index >= 0) { | 294 if (old_model_index >= 0) { |
| 295 GetTabAtTabDataIndex(ModelIndexToTabIndex(old_model_index))-> | 295 Tab* tab = GetTabAtTabDataIndex(ModelIndexToTabIndex(old_model_index)); |
| 296 StopMiniTabTitleAnimation(); | 296 tab->StopMiniTabTitleAnimation(); |
| 297 tab->SelectedChanged(); |
| 298 } |
| 299 if (new_model_index >= 0) { |
| 300 GetTabAtTabDataIndex( |
| 301 ModelIndexToTabIndex(new_model_index))->SelectedChanged(); |
| 297 } | 302 } |
| 298 } | 303 } |
| 299 | 304 |
| 300 void TabStrip::TabTitleChangedNotLoading(int model_index) { | 305 void TabStrip::TabTitleChangedNotLoading(int model_index) { |
| 301 Tab* tab = GetTabAtModelIndex(model_index); | 306 Tab* tab = GetTabAtModelIndex(model_index); |
| 302 if (tab->data().mini && !tab->IsSelected()) | 307 if (tab->data().mini && !tab->IsSelected()) |
| 303 tab->StartMiniTabTitleAnimation(); | 308 tab->StartMiniTabTitleAnimation(); |
| 304 } | 309 } |
| 305 | 310 |
| 306 void TabStrip::StartHighlight(int model_index) { | 311 void TabStrip::StartHighlight(int model_index) { |
| (...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1359 } | 1364 } |
| 1360 } | 1365 } |
| 1361 | 1366 |
| 1362 bool TabStrip::HasPhantomTabs() const { | 1367 bool TabStrip::HasPhantomTabs() const { |
| 1363 for (int i = 0; i < tab_count(); ++i) { | 1368 for (int i = 0; i < tab_count(); ++i) { |
| 1364 if (GetTabAtTabDataIndex(i)->data().phantom) | 1369 if (GetTabAtTabDataIndex(i)->data().phantom) |
| 1365 return true; | 1370 return true; |
| 1366 } | 1371 } |
| 1367 return false; | 1372 return false; |
| 1368 } | 1373 } |
| OLD | NEW |