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

Side by Side Diff: chrome/browser/policy/url_blacklist_manager.cc

Issue 10541046: Adds NetworkDelegate::NotifyBeforeSocketStreamConnect() (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed comments Created 8 years, 6 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
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/policy/url_blacklist_manager.h" 5 #include "chrome/browser/policy/url_blacklist_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 // static 199 // static
200 bool URLBlacklist::SchemeToFlag(const std::string& scheme, SchemeFlag* flag) { 200 bool URLBlacklist::SchemeToFlag(const std::string& scheme, SchemeFlag* flag) {
201 if (scheme.empty()) { 201 if (scheme.empty()) {
202 *flag = SCHEME_ALL; 202 *flag = SCHEME_ALL;
203 } else if (scheme == "http") { 203 } else if (scheme == "http") {
204 *flag = SCHEME_HTTP; 204 *flag = SCHEME_HTTP;
205 } else if (scheme == "https") { 205 } else if (scheme == "https") {
206 *flag = SCHEME_HTTPS; 206 *flag = SCHEME_HTTPS;
207 } else if (scheme == "ftp") { 207 } else if (scheme == "ftp") {
208 *flag = SCHEME_FTP; 208 *flag = SCHEME_FTP;
209 } else if (scheme == "ws") {
210 *flag = SCHEME_WS;
211 } else if (scheme == "wss") {
212 *flag = SCHEME_WSS;
209 } else { 213 } else {
210 return false; 214 return false;
211 } 215 }
212 return true; 216 return true;
213 } 217 }
214 218
215 // static 219 // static
216 bool URLBlacklist::FilterToComponents(const std::string& filter, 220 bool URLBlacklist::FilterToComponents(const std::string& filter,
217 std::string* scheme, 221 std::string* scheme,
218 std::string* host, 222 std::string* host,
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 411
408 // static 412 // static
409 void URLBlacklistManager::RegisterPrefs(PrefService* pref_service) { 413 void URLBlacklistManager::RegisterPrefs(PrefService* pref_service) {
410 pref_service->RegisterListPref(prefs::kUrlBlacklist, 414 pref_service->RegisterListPref(prefs::kUrlBlacklist,
411 PrefService::UNSYNCABLE_PREF); 415 PrefService::UNSYNCABLE_PREF);
412 pref_service->RegisterListPref(prefs::kUrlWhitelist, 416 pref_service->RegisterListPref(prefs::kUrlWhitelist,
413 PrefService::UNSYNCABLE_PREF); 417 PrefService::UNSYNCABLE_PREF);
414 } 418 }
415 419
416 } // namespace policy 420 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/url_blacklist_manager.h ('k') | chrome/browser/policy/url_blacklist_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698