| 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/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" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "chrome/browser/net/url_fixer_upper.h" | 12 #include "chrome/browser/net/url_fixer_upper.h" |
| 13 #include "chrome/browser/prefs/pref_registry_syncable.h" |
| 13 #include "chrome/browser/prefs/pref_service.h" | 14 #include "chrome/browser/prefs/pref_service.h" |
| 14 #include "chrome/common/chrome_notification_types.h" | 15 #include "chrome/common/chrome_notification_types.h" |
| 15 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
| 16 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
| 17 #include "content/public/browser/notification_details.h" | 18 #include "content/public/browser/notification_details.h" |
| 18 #include "content/public/browser/notification_source.h" | 19 #include "content/public/browser/notification_source.h" |
| 19 #include "googleurl/src/gurl.h" | 20 #include "googleurl/src/gurl.h" |
| 20 | 21 |
| 21 using content::BrowserThread; | 22 using content::BrowserThread; |
| 22 using extensions::URLMatcher; | 23 using extensions::URLMatcher; |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 353 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 353 blacklist_ = blacklist.Pass(); | 354 blacklist_ = blacklist.Pass(); |
| 354 } | 355 } |
| 355 | 356 |
| 356 bool URLBlacklistManager::IsURLBlocked(const GURL& url) const { | 357 bool URLBlacklistManager::IsURLBlocked(const GURL& url) const { |
| 357 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 358 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 358 return blacklist_->IsURLBlocked(url); | 359 return blacklist_->IsURLBlocked(url); |
| 359 } | 360 } |
| 360 | 361 |
| 361 // static | 362 // static |
| 362 void URLBlacklistManager::RegisterUserPrefs(PrefServiceSyncable* pref_service) { | 363 void URLBlacklistManager::RegisterUserPrefs(PrefRegistrySyncable* registry) { |
| 363 pref_service->RegisterListPref(prefs::kUrlBlacklist, | 364 registry->RegisterListPref(prefs::kUrlBlacklist, |
| 364 PrefServiceSyncable::UNSYNCABLE_PREF); | 365 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 365 pref_service->RegisterListPref(prefs::kUrlWhitelist, | 366 registry->RegisterListPref(prefs::kUrlWhitelist, |
| 366 PrefServiceSyncable::UNSYNCABLE_PREF); | 367 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 367 } | 368 } |
| 368 | 369 |
| 369 } // namespace policy | 370 } // namespace policy |
| OLD | NEW |