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/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/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 using extensions::URLMatcherPortFilter; | 37 using extensions::URLMatcherPortFilter; |
38 using extensions::URLMatcherSchemeFilter; | 38 using extensions::URLMatcherSchemeFilter; |
39 | 39 |
40 namespace policy { | 40 namespace policy { |
41 | 41 |
42 namespace { | 42 namespace { |
43 | 43 |
44 // Maximum filters per policy. Filters over this index are ignored. | 44 // Maximum filters per policy. Filters over this index are ignored. |
45 const size_t kMaxFiltersPerPolicy = 1000; | 45 const size_t kMaxFiltersPerPolicy = 1000; |
46 | 46 |
| 47 #if !defined(OS_CHROMEOS) |
| 48 |
47 const char kServiceLoginAuth[] = "/ServiceLoginAuth"; | 49 const char kServiceLoginAuth[] = "/ServiceLoginAuth"; |
48 | 50 |
49 #if !defined(OS_CHROMEOS) | |
50 | |
51 bool IsSigninFlowURL(const GURL& url) { | 51 bool IsSigninFlowURL(const GURL& url) { |
52 // Whitelist all the signin flow URLs flagged by the SigninManager. | 52 // Whitelist all the signin flow URLs flagged by the SigninManager. |
53 if (SigninManager::IsWebBasedSigninFlowURL(url)) | 53 if (SigninManager::IsWebBasedSigninFlowURL(url)) |
54 return true; | 54 return true; |
55 | 55 |
56 // Additionally whitelist /ServiceLoginAuth. | 56 // Additionally whitelist /ServiceLoginAuth. |
57 if (url.GetOrigin() != GaiaUrls::GetInstance()->gaia_url().GetOrigin()) | 57 if (url.GetOrigin() != GaiaUrls::GetInstance()->gaia_url().GetOrigin()) |
58 return false; | 58 return false; |
59 return url.path() == kServiceLoginAuth; | 59 return url.path() == kServiceLoginAuth; |
60 } | 60 } |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 // static | 393 // static |
394 void URLBlacklistManager::RegisterProfilePrefs( | 394 void URLBlacklistManager::RegisterProfilePrefs( |
395 user_prefs::PrefRegistrySyncable* registry) { | 395 user_prefs::PrefRegistrySyncable* registry) { |
396 registry->RegisterListPref(prefs::kUrlBlacklist, | 396 registry->RegisterListPref(prefs::kUrlBlacklist, |
397 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 397 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
398 registry->RegisterListPref(prefs::kUrlWhitelist, | 398 registry->RegisterListPref(prefs::kUrlWhitelist, |
399 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 399 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
400 } | 400 } |
401 | 401 |
402 } // namespace policy | 402 } // namespace policy |
OLD | NEW |