Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(913)

Side by Side Diff: chrome/browser/views/tabs/browser_tab_strip_controller.cc

Issue 2124003: More TabStrip refactoring. (Closed)
Patch Set: Merge with trunk Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/views/tabs/base_tab_strip.cc ('k') | chrome/browser/views/tabs/dragged_tab_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698