OLD | NEW |
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 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1170 if (!IsTabSelected(index)) { | 1170 if (!IsTabSelected(index)) { |
1171 std::vector<int> indices; | 1171 std::vector<int> indices; |
1172 indices.push_back(index); | 1172 indices.push_back(index); |
1173 return indices; | 1173 return indices; |
1174 } | 1174 } |
1175 return selection_model_.selected_indices(); | 1175 return selection_model_.selected_indices(); |
1176 } | 1176 } |
1177 | 1177 |
1178 bool TabStripModel::IsNewTabAtEndOfTabStrip(WebContents* contents) const { | 1178 bool TabStripModel::IsNewTabAtEndOfTabStrip(WebContents* contents) const { |
1179 const GURL& url = contents->GetURL(); | 1179 const GURL& url = contents->GetURL(); |
1180 return url.SchemeIs(chrome::kChromeUIScheme) && | 1180 return url.SchemeIs(content::kChromeUIScheme) && |
1181 url.host() == chrome::kChromeUINewTabHost && | 1181 url.host() == chrome::kChromeUINewTabHost && |
1182 contents == GetWebContentsAtImpl(count() - 1) && | 1182 contents == GetWebContentsAtImpl(count() - 1) && |
1183 contents->GetController().GetEntryCount() == 1; | 1183 contents->GetController().GetEntryCount() == 1; |
1184 } | 1184 } |
1185 | 1185 |
1186 bool TabStripModel::InternalCloseTabs(const std::vector<int>& indices, | 1186 bool TabStripModel::InternalCloseTabs(const std::vector<int>& indices, |
1187 uint32 close_types) { | 1187 uint32 close_types) { |
1188 if (indices.empty()) | 1188 if (indices.empty()) |
1189 return true; | 1189 return true; |
1190 | 1190 |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1397 void TabStripModel::ForgetOpenersAndGroupsReferencing( | 1397 void TabStripModel::ForgetOpenersAndGroupsReferencing( |
1398 const WebContents* tab) { | 1398 const WebContents* tab) { |
1399 for (WebContentsDataVector::const_iterator i = contents_data_.begin(); | 1399 for (WebContentsDataVector::const_iterator i = contents_data_.begin(); |
1400 i != contents_data_.end(); ++i) { | 1400 i != contents_data_.end(); ++i) { |
1401 if ((*i)->group() == tab) | 1401 if ((*i)->group() == tab) |
1402 (*i)->set_group(NULL); | 1402 (*i)->set_group(NULL); |
1403 if ((*i)->opener() == tab) | 1403 if ((*i)->opener() == tab) |
1404 (*i)->set_opener(NULL); | 1404 (*i)->set_opener(NULL); |
1405 } | 1405 } |
1406 } | 1406 } |
OLD | NEW |