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

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

Issue 7049004: Normalize chrome://foo/ trailing slashes, ChromeURLHostEquals comparison, RIP dead consts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Replace StartsWithASCII with scheme and host matching. Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/tabs/tab_strip_model.h" 5 #include "chrome/browser/tabs/tab_strip_model.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 if (!IsTabSelected(index)) { 1095 if (!IsTabSelected(index)) {
1096 std::vector<int> indices; 1096 std::vector<int> indices;
1097 indices.push_back(index); 1097 indices.push_back(index);
1098 return indices; 1098 return indices;
1099 } 1099 }
1100 return selection_model_.selected_indices(); 1100 return selection_model_.selected_indices();
1101 } 1101 }
1102 1102
1103 bool TabStripModel::IsNewTabAtEndOfTabStrip( 1103 bool TabStripModel::IsNewTabAtEndOfTabStrip(
1104 TabContentsWrapper* contents) const { 1104 TabContentsWrapper* contents) const {
1105 return LowerCaseEqualsASCII(contents->tab_contents()->GetURL().spec(), 1105 return contents == GetContentsAt(count() - 1) &&
1106 chrome::kChromeUINewTabURL) && 1106 contents->tab_contents()->GetURL() == GURL(chrome::kChromeUINewTabURL) &&
1107 contents == GetContentsAt(count() - 1) &&
1108 contents->controller().entry_count() == 1; 1107 contents->controller().entry_count() == 1;
1109 } 1108 }
1110 1109
1111 bool TabStripModel::InternalCloseTabs(const std::vector<int>& in_indices, 1110 bool TabStripModel::InternalCloseTabs(const std::vector<int>& in_indices,
1112 uint32 close_types) { 1111 uint32 close_types) {
1113 if (in_indices.empty()) 1112 if (in_indices.empty())
1114 return true; 1113 return true;
1115 1114
1116 std::vector<int> indices(in_indices); 1115 std::vector<int> indices(in_indices);
1117 bool retval = delegate_->CanCloseContents(&indices); 1116 bool retval = delegate_->CanCloseContents(&indices);
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
1310 void TabStripModel::ForgetOpenersAndGroupsReferencing( 1309 void TabStripModel::ForgetOpenersAndGroupsReferencing(
1311 const NavigationController* tab) { 1310 const NavigationController* tab) {
1312 for (TabContentsDataVector::const_iterator i = contents_data_.begin(); 1311 for (TabContentsDataVector::const_iterator i = contents_data_.begin();
1313 i != contents_data_.end(); ++i) { 1312 i != contents_data_.end(); ++i) {
1314 if ((*i)->group == tab) 1313 if ((*i)->group == tab)
1315 (*i)->group = NULL; 1314 (*i)->group = NULL;
1316 if ((*i)->opener == tab) 1315 if ((*i)->opener == tab)
1317 (*i)->opener = NULL; 1316 (*i)->opener = NULL;
1318 } 1317 }
1319 } 1318 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698