| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/views/tabs/browser_tab_strip_controller.h" | 5 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "chrome/browser/extensions/extension_tab_helper.h" | 9 #include "chrome/browser/extensions/extension_tab_helper.h" |
| 10 #include "chrome/browser/favicon/favicon_tab_helper.h" | 10 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 } | 333 } |
| 334 | 334 |
| 335 void BrowserTabStripController::TabDetachedAt(TabContentsWrapper* contents, | 335 void BrowserTabStripController::TabDetachedAt(TabContentsWrapper* contents, |
| 336 int model_index) { | 336 int model_index) { |
| 337 // Cancel any pending tab transition. | 337 // Cancel any pending tab transition. |
| 338 hover_tab_selector_.CancelTabTransition(); | 338 hover_tab_selector_.CancelTabTransition(); |
| 339 | 339 |
| 340 tabstrip_->RemoveTabAt(model_index); | 340 tabstrip_->RemoveTabAt(model_index); |
| 341 } | 341 } |
| 342 | 342 |
| 343 void BrowserTabStripController::TabSelectedAt(TabContentsWrapper* old_contents, | 343 void BrowserTabStripController::TabActivatedAt(TabContentsWrapper* old_contents, |
| 344 TabContentsWrapper* contents, | 344 TabContentsWrapper* contents, |
| 345 int model_index, | 345 int model_index, |
| 346 bool user_gesture) { | 346 bool user_gesture) { |
| 347 tabstrip_->SelectTabAt(model_->GetIndexOfTabContents(old_contents), | 347 tabstrip_->SelectTabAt(model_->GetIndexOfTabContents(old_contents), |
| 348 model_index); | 348 model_index); |
| 349 } | 349 } |
| 350 | 350 |
| 351 void BrowserTabStripController::TabMoved(TabContentsWrapper* contents, | 351 void BrowserTabStripController::TabMoved(TabContentsWrapper* contents, |
| 352 int from_model_index, | 352 int from_model_index, |
| 353 int to_model_index) { | 353 int to_model_index) { |
| 354 // Cancel any pending tab transition. | 354 // Cancel any pending tab transition. |
| 355 hover_tab_selector_.CancelTabTransition(); | 355 hover_tab_selector_.CancelTabTransition(); |
| 356 | 356 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 DCHECK(type.value == NotificationType::TAB_CLOSEABLE_STATE_CHANGED); | 471 DCHECK(type.value == NotificationType::TAB_CLOSEABLE_STATE_CHANGED); |
| 472 // Note that this notification may be fired during a model mutation and | 472 // Note that this notification may be fired during a model mutation and |
| 473 // possibly before the tabstrip has processed the change. | 473 // possibly before the tabstrip has processed the change. |
| 474 // Here, we just re-layout each existing tab to reflect the change in its | 474 // Here, we just re-layout each existing tab to reflect the change in its |
| 475 // closeable state, and then schedule paint for entire tabstrip. | 475 // closeable state, and then schedule paint for entire tabstrip. |
| 476 for (int i = 0; i < tabstrip_->tab_count(); ++i) { | 476 for (int i = 0; i < tabstrip_->tab_count(); ++i) { |
| 477 tabstrip_->base_tab_at_tab_index(i)->Layout(); | 477 tabstrip_->base_tab_at_tab_index(i)->Layout(); |
| 478 } | 478 } |
| 479 tabstrip_->SchedulePaint(); | 479 tabstrip_->SchedulePaint(); |
| 480 } | 480 } |
| OLD | NEW |