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

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

Issue 11111022: Remove TabContents from constrained windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove unrelated gtk code Created 8 years, 2 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 // Then move the non-pinned tabs. 349 // Then move the non-pinned tabs.
350 MoveSelectedTabsToImpl(std::max(index, total_mini_count), 350 MoveSelectedTabsToImpl(std::max(index, total_mini_count),
351 selected_mini_count, 351 selected_mini_count,
352 selected_count - selected_mini_count); 352 selected_count - selected_mini_count);
353 } 353 }
354 354
355 TabContents* TabStripModel::GetActiveTabContents() const { 355 TabContents* TabStripModel::GetActiveTabContents() const {
356 return GetTabContentsAt(active_index()); 356 return GetTabContentsAt(active_index());
357 } 357 }
358 358
359 content::WebContents* TabStripModel::GetActiveWebContents() const {
360 return GetTabContentsAt(active_index())->web_contents();
361 }
362
359 TabContents* TabStripModel::GetTabContentsAt(int index) const { 363 TabContents* TabStripModel::GetTabContentsAt(int index) const {
360 if (ContainsIndex(index)) 364 if (ContainsIndex(index))
361 return GetContentsAt(index); 365 return GetContentsAt(index);
362 return NULL; 366 return NULL;
363 } 367 }
364 368
369 content::WebContents* TabStripModel::GetWebContentsAt(int index) const {
370 if (ContainsIndex(index))
371 return GetContentsAt(index)->web_contents();
372 return NULL;
373 }
374
365 int TabStripModel::GetIndexOfTabContents(const TabContents* contents) const { 375 int TabStripModel::GetIndexOfTabContents(const TabContents* contents) const {
366 for (size_t i = 0; i < contents_data_.size(); ++i) { 376 for (size_t i = 0; i < contents_data_.size(); ++i) {
367 if (contents_data_[i]->contents == contents) 377 if (contents_data_[i]->contents == contents)
368 return i; 378 return i;
369 } 379 }
370 return kNoTab; 380 return kNoTab;
371 } 381 }
372 382
373 int TabStripModel::GetIndexOfWebContents(const WebContents* contents) const { 383 int TabStripModel::GetIndexOfWebContents(const WebContents* contents) const {
374 return contents ? 384 return contents ?
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
1319 void TabStripModel::ForgetOpenersAndGroupsReferencing( 1329 void TabStripModel::ForgetOpenersAndGroupsReferencing(
1320 const NavigationController* tab) { 1330 const NavigationController* tab) {
1321 for (TabContentsDataVector::const_iterator i = contents_data_.begin(); 1331 for (TabContentsDataVector::const_iterator i = contents_data_.begin();
1322 i != contents_data_.end(); ++i) { 1332 i != contents_data_.end(); ++i) {
1323 if ((*i)->group == tab) 1333 if ((*i)->group == tab)
1324 (*i)->group = NULL; 1334 (*i)->group = NULL;
1325 if ((*i)->opener == tab) 1335 if ((*i)->opener == tab)
1326 (*i)->opener = NULL; 1336 (*i)->opener = NULL;
1327 } 1337 }
1328 } 1338 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/tabs/tab_strip_model.h ('k') | chrome/browser/ui/views/constrained_window_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698