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

Unified Diff: chrome/browser/managed_mode/managed_mode_navigation_observer.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_navigation_observer.cc
diff --git a/chrome/browser/managed_mode/managed_mode_navigation_observer.cc b/chrome/browser/managed_mode/managed_mode_navigation_observer.cc
index 9499adf877d644d6901bb6695ba1bdf03ef05741..b7790b75067a040b739bad5abbd1e976caa83667 100644
--- a/chrome/browser/managed_mode/managed_mode_navigation_observer.cc
+++ b/chrome/browser/managed_mode/managed_mode_navigation_observer.cc
@@ -14,6 +14,8 @@
#include "chrome/browser/managed_mode/managed_mode_interstitial.h"
#include "chrome/browser/managed_mode/managed_mode_resource_throttle.h"
#include "chrome/browser/managed_mode/managed_mode_url_filter.h"
+#include "chrome/browser/managed_mode/managed_user_service.h"
+#include "chrome/browser/managed_mode/managed_user_service_factory.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
@@ -232,11 +234,15 @@ ManagedModeNavigationObserver::~ManagedModeNavigationObserver() {
ManagedModeNavigationObserver::ManagedModeNavigationObserver(
content::WebContents* web_contents)
: WebContentsObserver(web_contents),
- url_filter_(ManagedMode::GetURLFilterForUIThread()),
warn_infobar_delegate_(NULL),
preview_infobar_delegate_(NULL),
state_(RECORDING_URLS_BEFORE_PREVIEW),
- last_allowed_page_(-1) {}
+ last_allowed_page_(-1) {
+ Profile* profile =
+ Profile::FromBrowserContext(web_contents->GetBrowserContext());
+ managed_user_service_ = ManagedUserServiceFactory::GetForProfile(profile);
+ url_filter_ = managed_user_service_->GetURLFilterForUIThread();
+}
void ManagedModeNavigationObserver::AddTemporaryException() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -290,7 +296,7 @@ void ManagedModeNavigationObserver::AddSavedURLsToWhitelistAndClearState() {
whitelist.AppendString(last_url_.host());
}
}
- ManagedMode::AddToManualList(true, whitelist);
+ managed_user_service_->AddToManualList(true, whitelist);
ClearObserverState();
}

Powered by Google App Engine
This is Rietveld 408576698