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/custom_home_pages_table_model.h" | 5 #include "chrome/browser/custom_home_pages_table_model.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
152 if (browser->profile() != profile_) | 152 if (browser->profile() != profile_) |
153 continue; // Skip incognito browsers. | 153 continue; // Skip incognito browsers. |
154 | 154 |
155 for (int tab_index = 0; tab_index < browser->tab_count(); ++tab_index) { | 155 for (int tab_index = 0; tab_index < browser->tab_count(); ++tab_index) { |
156 const GURL url = browser->GetWebContentsAt(tab_index)->GetURL(); | 156 const GURL url = browser->GetWebContentsAt(tab_index)->GetURL(); |
157 // TODO(tbreisacher) remove kChromeUISettingsHost once options is deleted | 157 // TODO(tbreisacher) remove kChromeUISettingsHost once options is deleted |
158 // and replaced by options2 | 158 // and replaced by options2 |
159 if (!url.is_empty() && | 159 if (!url.is_empty() && |
160 !(url.SchemeIs(chrome::kChromeUIScheme) && | 160 !(url.SchemeIs(chrome::kChromeUIScheme) && |
161 (url.host() == chrome::kChromeUISettingsHost || | 161 (url.host() == chrome::kChromeUISettingsHost || |
162 url.host() == chrome::kChromeUIUberHost))) { | 162 url.host() == chrome::kChromeUIUberHost)) && |
Evan Stade
2012/03/10 03:11:48
this seems wrong actually, you might want to have
| |
163 !url.SchemeIs(chrome::kChromeDevToolsScheme)) { | |
163 Add(add_index++, url); | 164 Add(add_index++, url); |
164 } | 165 } |
165 } | 166 } |
166 } | 167 } |
167 } | 168 } |
168 | 169 |
169 std::vector<GURL> CustomHomePagesTableModel::GetURLs() { | 170 std::vector<GURL> CustomHomePagesTableModel::GetURLs() { |
170 std::vector<GURL> urls(entries_.size()); | 171 std::vector<GURL> urls(entries_.size()); |
171 for (size_t i = 0; i < entries_.size(); ++i) | 172 for (size_t i = 0; i < entries_.size(); ++i) |
172 urls[i] = entries_[i].url; | 173 urls[i] = entries_[i].url; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
237 return NULL; | 238 return NULL; |
238 } | 239 } |
239 | 240 |
240 string16 CustomHomePagesTableModel::FormattedURL(int row) const { | 241 string16 CustomHomePagesTableModel::FormattedURL(int row) const { |
241 std::string languages = | 242 std::string languages = |
242 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages); | 243 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages); |
243 string16 url = net::FormatUrl(entries_[row].url, languages); | 244 string16 url = net::FormatUrl(entries_[row].url, languages); |
244 url = base::i18n::GetDisplayStringInLTRDirectionality(url); | 245 url = base::i18n::GetDisplayStringInLTRDirectionality(url); |
245 return url; | 246 return url; |
246 } | 247 } |
OLD | NEW |