| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/extensions/tab_helper.h" | 10 #include "chrome/browser/extensions/tab_helper.h" |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 | 379 |
| 380 tabstrip_->RemoveTabAt(model_index); | 380 tabstrip_->RemoveTabAt(model_index); |
| 381 } | 381 } |
| 382 | 382 |
| 383 void BrowserTabStripController::TabSelectionChanged( | 383 void BrowserTabStripController::TabSelectionChanged( |
| 384 TabStripModel* tab_strip_model, | 384 TabStripModel* tab_strip_model, |
| 385 const TabStripSelectionModel& old_model) { | 385 const TabStripSelectionModel& old_model) { |
| 386 tabstrip_->SetSelection(old_model, model_->selection_model()); | 386 tabstrip_->SetSelection(old_model, model_->selection_model()); |
| 387 } | 387 } |
| 388 | 388 |
| 389 void BrowserTabStripController::TabMoved(TabContents* contents, | 389 void BrowserTabStripController::TabMoved(WebContents* contents, |
| 390 int from_model_index, | 390 int from_model_index, |
| 391 int to_model_index) { | 391 int to_model_index) { |
| 392 // Cancel any pending tab transition. | 392 // Cancel any pending tab transition. |
| 393 hover_tab_selector_.CancelTabTransition(); | 393 hover_tab_selector_.CancelTabTransition(); |
| 394 | 394 |
| 395 // Pass in the TabRendererData as the pinned state may have changed. | 395 // Pass in the TabRendererData as the pinned state may have changed. |
| 396 TabRendererData data; | 396 TabRendererData data; |
| 397 SetTabRendererDataFromModel(contents->web_contents(), to_model_index, &data, | 397 SetTabRendererDataFromModel(contents, to_model_index, &data, EXISTING_TAB); |
| 398 EXISTING_TAB); | |
| 399 tabstrip_->MoveTab(from_model_index, to_model_index, data); | 398 tabstrip_->MoveTab(from_model_index, to_model_index, data); |
| 400 } | 399 } |
| 401 | 400 |
| 402 void BrowserTabStripController::TabChangedAt(TabContents* contents, | 401 void BrowserTabStripController::TabChangedAt(TabContents* contents, |
| 403 int model_index, | 402 int model_index, |
| 404 TabChangeType change_type) { | 403 TabChangeType change_type) { |
| 405 if (change_type == TITLE_NOT_LOADING) { | 404 if (change_type == TITLE_NOT_LOADING) { |
| 406 tabstrip_->TabTitleChangedNotLoading(model_index); | 405 tabstrip_->TabTitleChangedNotLoading(model_index); |
| 407 // We'll receive another notification of the change asynchronously. | 406 // We'll receive another notification of the change asynchronously. |
| 408 return; | 407 return; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 SetTabRendererDataFromModel(contents, index, &data, NEW_TAB); | 514 SetTabRendererDataFromModel(contents, index, &data, NEW_TAB); |
| 516 tabstrip_->AddTabAt(index, data, is_active); | 515 tabstrip_->AddTabAt(index, data, is_active); |
| 517 } | 516 } |
| 518 | 517 |
| 519 void BrowserTabStripController::UpdateLayoutType() { | 518 void BrowserTabStripController::UpdateLayoutType() { |
| 520 bool adjust_layout = false; | 519 bool adjust_layout = false; |
| 521 TabStripLayoutType layout_type = | 520 TabStripLayoutType layout_type = |
| 522 DetermineTabStripLayout(g_browser_process->local_state(), &adjust_layout); | 521 DetermineTabStripLayout(g_browser_process->local_state(), &adjust_layout); |
| 523 tabstrip_->SetLayoutType(layout_type, adjust_layout); | 522 tabstrip_->SetLayoutType(layout_type, adjust_layout); |
| 524 } | 523 } |
| OLD | NEW |