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

Side by Side Diff: chrome/browser/custom_home_pages_table_model.cc

Issue 9663044: Don't add devtools to list of startup pages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: exclude chrome://chrome/settings and chrome://settings, but not extensions pages Created 8 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 Browser* browser = *browser_i; 151 Browser* browser = *browser_i;
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.spec().find("chrome://chrome/settings") != 0 &&
Evan Stade 2012/03/10 03:45:03 should use constant... how about checking path sta
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698