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

Side by Side Diff: chrome/browser/ui/tabs/tab_strip_model.cc

Issue 10702029: Move tab functions off Browser into browser_tabstrip and browser_tabrestore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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
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/tabs/tab_strip_model.h" 5 #include "chrome/browser/ui/tabs/tab_strip_model.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 int TabStripModel::GetIndexOfWebContents(const WebContents* contents) const { 373 int TabStripModel::GetIndexOfWebContents(const WebContents* contents) const {
374 int index = 0; 374 int index = 0;
375 TabContentsDataVector::const_iterator iter = contents_data_.begin(); 375 TabContentsDataVector::const_iterator iter = contents_data_.begin();
376 for (; iter != contents_data_.end(); ++iter, ++index) { 376 for (; iter != contents_data_.end(); ++iter, ++index) {
377 if ((*iter)->contents->web_contents() == contents) 377 if ((*iter)->contents->web_contents() == contents)
378 return index; 378 return index;
379 } 379 }
380 return kNoTab; 380 return kNoTab;
381 } 381 }
382 382
383 int TabStripModel::GetIndexOfController(
384 const NavigationController* controller) const {
385 int index = 0;
386 TabContentsDataVector::const_iterator iter = contents_data_.begin();
387 for (; iter != contents_data_.end(); ++iter, ++index) {
388 if (&(*iter)->contents->web_contents()->GetController() == controller)
389 return index;
390 }
391 return kNoTab;
392 }
393
394 void TabStripModel::UpdateTabContentsStateAt(int index, 383 void TabStripModel::UpdateTabContentsStateAt(int index,
395 TabStripModelObserver::TabChangeType change_type) { 384 TabStripModelObserver::TabChangeType change_type) {
396 DCHECK(ContainsIndex(index)); 385 DCHECK(ContainsIndex(index));
397 386
398 FOR_EACH_OBSERVER(TabStripModelObserver, observers_, 387 FOR_EACH_OBSERVER(TabStripModelObserver, observers_,
399 TabChangedAt(GetContentsAt(index), index, change_type)); 388 TabChangedAt(GetContentsAt(index), index, change_type));
400 } 389 }
401 390
402 void TabStripModel::CloseAllTabs() { 391 void TabStripModel::CloseAllTabs() {
403 // Set state so that observers can adjust their behavior to suit this 392 // Set state so that observers can adjust their behavior to suit this
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after
1338 void TabStripModel::ForgetOpenersAndGroupsReferencing( 1327 void TabStripModel::ForgetOpenersAndGroupsReferencing(
1339 const NavigationController* tab) { 1328 const NavigationController* tab) {
1340 for (TabContentsDataVector::const_iterator i = contents_data_.begin(); 1329 for (TabContentsDataVector::const_iterator i = contents_data_.begin();
1341 i != contents_data_.end(); ++i) { 1330 i != contents_data_.end(); ++i) {
1342 if ((*i)->group == tab) 1331 if ((*i)->group == tab)
1343 (*i)->group = NULL; 1332 (*i)->group = NULL;
1344 if ((*i)->opener == tab) 1333 if ((*i)->opener == tab)
1345 (*i)->opener = NULL; 1334 (*i)->opener = NULL;
1346 } 1335 }
1347 } 1336 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/tabs/tab_strip_model.h ('k') | chrome/browser/ui/tabs/tab_strip_model_order_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698