| 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/fake_base_tab_strip_controller.h" | 5 #include "chrome/browser/ui/views/tabs/fake_base_tab_strip_controller.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/views/tabs/tab_renderer_data.h" | 7 #include "chrome/browser/ui/views/tabs/tab_renderer_data.h" |
| 8 #include "chrome/browser/ui/views/tabs/tab_strip.h" | 8 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
| 9 | 9 |
| 10 FakeBaseTabStripController::FakeBaseTabStripController() | 10 FakeBaseTabStripController::FakeBaseTabStripController() |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 bool FakeBaseTabStripController::IsTabPinned(int index) const { | 60 bool FakeBaseTabStripController::IsTabPinned(int index) const { |
| 61 return false; | 61 return false; |
| 62 } | 62 } |
| 63 | 63 |
| 64 bool FakeBaseTabStripController::IsNewTabPage(int index) const { | 64 bool FakeBaseTabStripController::IsNewTabPage(int index) const { |
| 65 return false; | 65 return false; |
| 66 } | 66 } |
| 67 | 67 |
| 68 void FakeBaseTabStripController::SelectTab(int index) { | 68 void FakeBaseTabStripController::SelectTab(int index) { |
| 69 if (!IsValidIndex(index)) | 69 if (!IsValidIndex(index) || active_index_ == index) |
| 70 return; | 70 return; |
| 71 ui::ListSelectionModel old_selection_model; |
| 72 old_selection_model.SetSelectedIndex(active_index_); |
| 71 active_index_ = index; | 73 active_index_ = index; |
| 74 selection_model_.SetSelectedIndex(active_index_); |
| 75 tab_strip_->SetSelection(old_selection_model, selection_model_); |
| 72 } | 76 } |
| 73 | 77 |
| 74 void FakeBaseTabStripController::ExtendSelectionTo(int index) { | 78 void FakeBaseTabStripController::ExtendSelectionTo(int index) { |
| 75 } | 79 } |
| 76 | 80 |
| 77 void FakeBaseTabStripController::ToggleSelected(int index) { | 81 void FakeBaseTabStripController::ToggleSelected(int index) { |
| 78 } | 82 } |
| 79 | 83 |
| 80 void FakeBaseTabStripController::AddSelectionFromAnchorTo(int index) { | 84 void FakeBaseTabStripController::AddSelectionFromAnchorTo(int index) { |
| 81 } | 85 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 132 |
| 129 void FakeBaseTabStripController::OnStartedDraggingTabs() { | 133 void FakeBaseTabStripController::OnStartedDraggingTabs() { |
| 130 } | 134 } |
| 131 | 135 |
| 132 void FakeBaseTabStripController::OnStoppedDraggingTabs() { | 136 void FakeBaseTabStripController::OnStoppedDraggingTabs() { |
| 133 } | 137 } |
| 134 | 138 |
| 135 void FakeBaseTabStripController::CheckFileSupported(const GURL& url) { | 139 void FakeBaseTabStripController::CheckFileSupported(const GURL& url) { |
| 136 tab_strip_->FileSupported(url, true); | 140 tab_strip_->FileSupported(url, true); |
| 137 } | 141 } |
| OLD | NEW |