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

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

Issue 10825221: views: Use Tab pointer directly when calling TabStrip::tab_at. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/tab_strip.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 const gfx::Point& p) { 285 const gfx::Point& p) {
286 context_menu_contents_.reset(new TabContextMenuContents(tab, this)); 286 context_menu_contents_.reset(new TabContextMenuContents(tab, this));
287 context_menu_contents_->RunMenuAt(p); 287 context_menu_contents_->RunMenuAt(p);
288 } 288 }
289 289
290 void BrowserTabStripController::UpdateLoadingAnimations() { 290 void BrowserTabStripController::UpdateLoadingAnimations() {
291 // Don't use the model count here as it's possible for this to be invoked 291 // Don't use the model count here as it's possible for this to be invoked
292 // before we've applied an update from the model (Browser::TabInsertedAt may 292 // before we've applied an update from the model (Browser::TabInsertedAt may
293 // be processed before us and invokes this). 293 // be processed before us and invokes this).
294 for (int i = 0, tab_count = tabstrip_->tab_count(); i < tab_count; ++i) { 294 for (int i = 0, tab_count = tabstrip_->tab_count(); i < tab_count; ++i) {
295 BaseTab* tab = tabstrip_->tab_at(i);
296 if (model_->ContainsIndex(i)) { 295 if (model_->ContainsIndex(i)) {
296 Tab* tab = tabstrip_->tab_at(i);
297 TabContents* contents = model_->GetTabContentsAt(i); 297 TabContents* contents = model_->GetTabContentsAt(i);
298 tab->UpdateLoadingAnimation( 298 tab->UpdateLoadingAnimation(
299 TabContentsNetworkState(contents->web_contents())); 299 TabContentsNetworkState(contents->web_contents()));
300 } 300 }
301 } 301 }
302 } 302 }
303 303
304 int BrowserTabStripController::HasAvailableDragActions() const { 304 int BrowserTabStripController::HasAvailableDragActions() const {
305 return model_->delegate()->GetDragActions(); 305 return model_->delegate()->GetDragActions();
306 } 306 }
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 SetTabRendererDataFromModel(contents->web_contents(), index, &data, NEW_TAB); 583 SetTabRendererDataFromModel(contents->web_contents(), index, &data, NEW_TAB);
584 tabstrip_->AddTabAt(index, data, is_active); 584 tabstrip_->AddTabAt(index, data, is_active);
585 } 585 }
586 586
587 void BrowserTabStripController::UpdateLayoutType() { 587 void BrowserTabStripController::UpdateLayoutType() {
588 bool adjust_layout = false; 588 bool adjust_layout = false;
589 TabStripLayoutType layout_type = 589 TabStripLayoutType layout_type =
590 DetermineTabStripLayout(g_browser_process->local_state(), &adjust_layout); 590 DetermineTabStripLayout(g_browser_process->local_state(), &adjust_layout);
591 tabstrip_->SetLayoutType(layout_type, adjust_layout); 591 tabstrip_->SetLayoutType(layout_type, adjust_layout);
592 } 592 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/tab_strip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698