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

Unified Diff: chrome/browser/managed_mode/managed_mode_url_filter.cc

Issue 11826059: Add ManagedUserService for profile-specific managed user data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win fix Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/managed_mode/managed_mode_url_filter.cc
diff --git a/chrome/browser/managed_mode/managed_mode_url_filter.cc b/chrome/browser/managed_mode/managed_mode_url_filter.cc
index 453432109dd023844f5b63c51261f79fca1eddb5..ff131f665605f0aff7c480b996d301505f5620dd 100644
--- a/chrome/browser/managed_mode/managed_mode_url_filter.cc
+++ b/chrome/browser/managed_mode/managed_mode_url_filter.cc
@@ -157,15 +157,14 @@ scoped_ptr<ManagedModeURLFilter::Contents> LoadWhitelistsOnBlockingPoolThread(
} // namespace
ManagedModeURLFilter::ManagedModeURLFilter()
- : ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)),
- default_behavior_(ALLOW),
+ : default_behavior_(ALLOW),
contents_(new Contents()),
url_manual_list_allow_(new policy::URLBlacklist()),
url_manual_list_block_(new policy::URLBlacklist()) {
// Set empty manual lists in the begining.
- scoped_ptr<base::ListValue> whitelist(new base::ListValue());
- scoped_ptr<base::ListValue> blacklist(new base::ListValue());
- SetManualLists(whitelist.Pass(), blacklist.Pass());
+ base::ListValue whitelist;
+ base::ListValue blacklist;
+ SetManualLists(&whitelist, &blacklist);
// Detach from the current thread so we can be constructed on a different
// thread than the one where we're used.
DetachFromThread();
@@ -262,8 +261,7 @@ void ManagedModeURLFilter::LoadWhitelists(
FROM_HERE,
base::Bind(&LoadWhitelistsOnBlockingPoolThread,
base::Passed(&site_lists)),
- base::Bind(&ManagedModeURLFilter::SetContents,
- weak_ptr_factory_.GetWeakPtr()));
+ base::Bind(&ManagedModeURLFilter::SetContents, this));
}
void ManagedModeURLFilter::SetFromPatterns(
@@ -274,31 +272,30 @@ void ManagedModeURLFilter::SetFromPatterns(
BrowserThread::GetBlockingPool(),
FROM_HERE,
base::Bind(&CreateWhitelistFromPatterns, patterns),
- base::Bind(&ManagedModeURLFilter::SetContents,
- weak_ptr_factory_.GetWeakPtr()));
+ base::Bind(&ManagedModeURLFilter::SetContents, this));
}
-void ManagedModeURLFilter::SetManualLists(scoped_ptr<ListValue> whitelist,
- scoped_ptr<ListValue> blacklist){
+void ManagedModeURLFilter::SetManualLists(const ListValue* whitelist,
+ const ListValue* blacklist) {
DCHECK(CalledOnValidThread());
url_manual_list_block_.reset(new policy::URLBlacklist);
url_manual_list_allow_.reset(new policy::URLBlacklist);
- url_manual_list_block_->Block(blacklist.get());
+ url_manual_list_block_->Block(blacklist);
ListValue all_sites;
all_sites.Append(new base::StringValue("*"));
- url_manual_list_allow_->Allow(whitelist.get());
+ url_manual_list_allow_->Allow(whitelist);
url_manual_list_allow_->Block(&all_sites);
// Debug
DVLOG(1) << "Loaded whitelist: ";
- for (ListValue::iterator it = whitelist->begin();
+ for (ListValue::const_iterator it = whitelist->begin();
it != whitelist->end(); ++it){
std::string item;
(*it)->GetAsString(&item);
DVLOG(1) << item;
}
DVLOG(1) << "Loaded blacklist: ";
- for (ListValue::iterator it = blacklist->begin();
+ for (ListValue::const_iterator it = blacklist->begin();
it != blacklist->end(); ++it){
std::string item;
(*it)->GetAsString(&item);

Powered by Google App Engine
This is Rietveld 408576698