| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/policy/core/browser/url_blacklist_manager.h" | 5 #include "components/policy/core/browser/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/location.h" | 9 #include "base/location.h" |
| 10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 base::Passed(&block), | 462 base::Passed(&block), |
| 463 base::Passed(&allow))); | 463 base::Passed(&allow))); |
| 464 } | 464 } |
| 465 | 465 |
| 466 void URLBlacklistManager::UpdateOnIO(scoped_ptr<base::ListValue> block, | 466 void URLBlacklistManager::UpdateOnIO(scoped_ptr<base::ListValue> block, |
| 467 scoped_ptr<base::ListValue> allow) { | 467 scoped_ptr<base::ListValue> allow) { |
| 468 DCHECK(io_task_runner_->RunsTasksOnCurrentThread()); | 468 DCHECK(io_task_runner_->RunsTasksOnCurrentThread()); |
| 469 // The URLBlacklist is built on a worker thread. Once it's ready, it is passed | 469 // The URLBlacklist is built on a worker thread. Once it's ready, it is passed |
| 470 // to the URLBlacklistManager on IO. | 470 // to the URLBlacklistManager on IO. |
| 471 base::PostTaskAndReplyWithResult( | 471 base::PostTaskAndReplyWithResult( |
| 472 background_task_runner_, | 472 background_task_runner_.get(), |
| 473 FROM_HERE, | 473 FROM_HERE, |
| 474 base::Bind(&BuildBlacklist, | 474 base::Bind(&BuildBlacklist, |
| 475 base::Passed(&block), | 475 base::Passed(&block), |
| 476 base::Passed(&allow), | 476 base::Passed(&allow), |
| 477 segment_url_), | 477 segment_url_), |
| 478 base::Bind(&URLBlacklistManager::SetBlacklist, | 478 base::Bind(&URLBlacklistManager::SetBlacklist, |
| 479 io_weak_ptr_factory_.GetWeakPtr())); | 479 io_weak_ptr_factory_.GetWeakPtr())); |
| 480 } | 480 } |
| 481 | 481 |
| 482 void URLBlacklistManager::SetBlacklist(scoped_ptr<URLBlacklist> blacklist) { | 482 void URLBlacklistManager::SetBlacklist(scoped_ptr<URLBlacklist> blacklist) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 510 // static | 510 // static |
| 511 void URLBlacklistManager::RegisterProfilePrefs( | 511 void URLBlacklistManager::RegisterProfilePrefs( |
| 512 user_prefs::PrefRegistrySyncable* registry) { | 512 user_prefs::PrefRegistrySyncable* registry) { |
| 513 registry->RegisterListPref(policy_prefs::kUrlBlacklist, | 513 registry->RegisterListPref(policy_prefs::kUrlBlacklist, |
| 514 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 514 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 515 registry->RegisterListPref(policy_prefs::kUrlWhitelist, | 515 registry->RegisterListPref(policy_prefs::kUrlWhitelist, |
| 516 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 516 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 517 } | 517 } |
| 518 | 518 |
| 519 } // namespace policy | 519 } // namespace policy |
| OLD | NEW |