OLD | NEW |
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 Loading... |
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 const GURL& url = contents->tab_contents()->GetURL(); |
1106 chrome::kChromeUINewTabURL) && | 1106 return chrome::IsChromeURL(url, chrome::kChromeUINewTabHost) && |
1107 contents == GetContentsAt(count() - 1) && | 1107 contents == GetContentsAt(count() - 1) && |
1108 contents->controller().entry_count() == 1; | 1108 contents->controller().entry_count() == 1; |
1109 } | 1109 } |
1110 | 1110 |
1111 bool TabStripModel::InternalCloseTabs(const std::vector<int>& in_indices, | 1111 bool TabStripModel::InternalCloseTabs(const std::vector<int>& in_indices, |
1112 uint32 close_types) { | 1112 uint32 close_types) { |
1113 if (in_indices.empty()) | 1113 if (in_indices.empty()) |
1114 return true; | 1114 return true; |
1115 | 1115 |
1116 std::vector<int> indices(in_indices); | 1116 std::vector<int> indices(in_indices); |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1310 void TabStripModel::ForgetOpenersAndGroupsReferencing( | 1310 void TabStripModel::ForgetOpenersAndGroupsReferencing( |
1311 const NavigationController* tab) { | 1311 const NavigationController* tab) { |
1312 for (TabContentsDataVector::const_iterator i = contents_data_.begin(); | 1312 for (TabContentsDataVector::const_iterator i = contents_data_.begin(); |
1313 i != contents_data_.end(); ++i) { | 1313 i != contents_data_.end(); ++i) { |
1314 if ((*i)->group == tab) | 1314 if ((*i)->group == tab) |
1315 (*i)->group = NULL; | 1315 (*i)->group = NULL; |
1316 if ((*i)->opener == tab) | 1316 if ((*i)->opener == tab) |
1317 (*i)->opener = NULL; | 1317 (*i)->opener = NULL; |
1318 } | 1318 } |
1319 } | 1319 } |
OLD | NEW |