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

Unified Diff: chrome/browser/prefs/incognito_mode_prefs.cc

Issue 136693011: Disable incognito if parental controls are enabled on android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Keep native_test as the package to be compliant w/ testing framework Created 6 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
« no previous file with comments | « chrome/browser/prefs/incognito_mode_prefs.h ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prefs/incognito_mode_prefs.cc
diff --git a/chrome/browser/prefs/incognito_mode_prefs.cc b/chrome/browser/prefs/incognito_mode_prefs.cc
index 7ca0e29ffc422763127a2bf778ab0c02f1b04ed5..f68709c03de2eedf9fdaef0535fcaa01139e7f02 100644
--- a/chrome/browser/prefs/incognito_mode_prefs.cc
+++ b/chrome/browser/prefs/incognito_mode_prefs.cc
@@ -16,6 +16,10 @@
#include "base/win/metro.h"
#endif // OS_WIN
+#if defined(OS_ANDROID)
+#include "chrome/browser/android/chromium_application.h"
+#endif // OS_ANDROID
+
// static
bool IncognitoModePrefs::IntToAvailability(int in_value,
Availability* out_value) {
@@ -35,15 +39,11 @@ IncognitoModePrefs::Availability IncognitoModePrefs::GetAvailability(
Availability result = IncognitoModePrefs::ENABLED;
bool valid = IntToAvailability(pref_value, &result);
DCHECK(valid);
-#if defined(OS_WIN)
- // Disable incognito mode windows if parental controls are on. This is only
- // for Windows Vista and above.
- if (base::win::IsParentalControlActivityLoggingOn()) {
+ if (ArePlatformParentalControlsEnabled()) {
if (result == IncognitoModePrefs::FORCED)
LOG(ERROR) << "Ignoring FORCED incognito. Parental control logging on";
return IncognitoModePrefs::DISABLED;
}
-#endif // OS_WIN
return result;
}
@@ -87,3 +87,15 @@ bool IncognitoModePrefs::CanOpenBrowser(Profile* profile) {
NOTREACHED();
return false;
}
+
+// static
+bool IncognitoModePrefs::ArePlatformParentalControlsEnabled() {
+#if defined(OS_WIN)
+ // Disable incognito mode windows if parental controls are on. This is only
+ // for Windows Vista and above.
+ return base::win::IsParentalControlActivityLoggingOn();
+#elif defined(OS_ANDROID)
+ return chrome::android::ChromiumApplication::AreParentalControlsEnabled();
+#endif
+ return false;
+}
« no previous file with comments | « chrome/browser/prefs/incognito_mode_prefs.h ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698