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

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

Issue 12413028: Add elevation to the managed mode navigation observer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add elevation state to the managed mode navigation observer. Created 7 years, 9 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 af66cf33aa5be0f03abd13c420302de2ee808fe3..ab79cc72b07e8a02307a0a758397504ed466e3e7 100644
--- a/chrome/browser/managed_mode/managed_mode_navigation_observer.cc
+++ b/chrome/browser/managed_mode/managed_mode_navigation_observer.cc
@@ -263,10 +263,13 @@ ManagedModeNavigationObserver::ManagedModeNavigationObserver(
preview_infobar_delegate_(NULL),
got_user_gesture_(false),
state_(RECORDING_URLS_BEFORE_PREVIEW),
+ is_elevated_(false),
last_allowed_page_(-1) {
Profile* profile =
Profile::FromBrowserContext(web_contents->GetBrowserContext());
managed_user_service_ = ManagedUserServiceFactory::GetForProfile(profile);
+ if (!managed_user_service_->ProfileIsManaged())
+ is_elevated_ = true;
url_filter_ = managed_user_service_->GetURLFilterForUIThread();
}
@@ -341,6 +344,14 @@ void ManagedModeNavigationObserver::AddSavedURLsToWhitelistAndClearState() {
ClearObserverState();
}
+bool ManagedModeNavigationObserver::is_elevated() const {
+ return is_elevated_;
+}
+
+void ManagedModeNavigationObserver::SetElevated(bool is_elevated) {
+ is_elevated_ = is_elevated;
+}
+
void ManagedModeNavigationObserver::AddURLToPatternList(const GURL& url) {
navigated_urls_.insert(url);
last_url_ = url;
@@ -511,3 +522,4 @@ void ManagedModeNavigationObserver::DidGetUserGesture() {
// there was a manual navigation.
UpdateExceptionNavigationStatus();
}
+
Bernhard Bauer 2013/03/20 15:08:30 Is this newline necessary?
Adrian Kuegel 2013/03/20 15:51:16 No, that was a leftover from copying the new metho

Powered by Google App Engine
This is Rietveld 408576698