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/browser_tab_strip_controller.h" | 5 #include "chrome/browser/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.h" | 9 #include "chrome/browser/browser.h" |
10 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 void BrowserTabStripController::ShowContextMenu(BaseTabRenderer* tab, | 204 void BrowserTabStripController::ShowContextMenu(BaseTabRenderer* tab, |
205 const gfx::Point& p) { | 205 const gfx::Point& p) { |
206 context_menu_contents_.reset(new TabContextMenuContents(tab, this)); | 206 context_menu_contents_.reset(new TabContextMenuContents(tab, this)); |
207 context_menu_contents_->RunMenuAt(p); | 207 context_menu_contents_->RunMenuAt(p); |
208 } | 208 } |
209 | 209 |
210 void BrowserTabStripController::UpdateLoadingAnimations() { | 210 void BrowserTabStripController::UpdateLoadingAnimations() { |
211 // Don't use the model count here as it's possible for this to be invoked | 211 // Don't use the model count here as it's possible for this to be invoked |
212 // before we've applied an update from the model (Browser::TabInsertedAt may | 212 // before we've applied an update from the model (Browser::TabInsertedAt may |
213 // be processed before us and invokes this). | 213 // be processed before us and invokes this). |
214 for (int tab_index = 0, tab_count = tabstrip_->GetTabCount(); | 214 for (int tab_index = 0, tab_count = tabstrip_->tab_count(); |
215 tab_index < tab_count; ++tab_index) { | 215 tab_index < tab_count; ++tab_index) { |
216 BaseTabRenderer* tab = tabstrip_->GetBaseTabAtTabIndex(tab_index); | 216 BaseTabRenderer* tab = tabstrip_->base_tab_at_tab_index(tab_index); |
217 int model_index = tabstrip_->GetModelIndexOfBaseTab(tab); | 217 int model_index = tabstrip_->GetModelIndexOfBaseTab(tab); |
218 if (model_->ContainsIndex(model_index)) { | 218 if (model_->ContainsIndex(model_index)) { |
219 TabContents* contents = model_->GetTabContentsAt(model_index); | 219 TabContents* contents = model_->GetTabContentsAt(model_index); |
220 tab->UpdateLoadingAnimation(TabContentsNetworkState(contents)); | 220 tab->UpdateLoadingAnimation(TabContentsNetworkState(contents)); |
221 } | 221 } |
222 } | 222 } |
223 } | 223 } |
224 | 224 |
225 int BrowserTabStripController::HasAvailableDragActions() const { | 225 int BrowserTabStripController::HasAvailableDragActions() const { |
226 return model_->delegate()->GetDragActions(); | 226 return model_->delegate()->GetDragActions(); |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 void BrowserTabStripController::StopHighlightTabsForCommand( | 391 void BrowserTabStripController::StopHighlightTabsForCommand( |
392 TabStripModel::ContextMenuCommand command_id, | 392 TabStripModel::ContextMenuCommand command_id, |
393 BaseTabRenderer* tab) { | 393 BaseTabRenderer* tab) { |
394 if (command_id == TabStripModel::CommandCloseTabsOpenedBy || | 394 if (command_id == TabStripModel::CommandCloseTabsOpenedBy || |
395 command_id == TabStripModel::CommandCloseTabsToRight || | 395 command_id == TabStripModel::CommandCloseTabsToRight || |
396 command_id == TabStripModel::CommandCloseOtherTabs) { | 396 command_id == TabStripModel::CommandCloseOtherTabs) { |
397 // Just tell all Tabs to stop pulsing - it's safe. | 397 // Just tell all Tabs to stop pulsing - it's safe. |
398 tabstrip_->StopAllHighlighting(); | 398 tabstrip_->StopAllHighlighting(); |
399 } | 399 } |
400 } | 400 } |
OLD | NEW |