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

Unified Diff: chrome/browser/profiles/profile_io_data.cc

Issue 336213005: Disable incognito link if parental control is on (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 6 years, 6 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/profiles/profile_io_data.h ('k') | chrome/browser/signin/signin_header_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_io_data.cc
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc
index 6e14ddcf3471d3f2ede004a0225897cbe5f23048..353d458b5a98109eebb370d194e1c154d70e5aad 100644
--- a/chrome/browser/profiles/profile_io_data.cc
+++ b/chrome/browser/profiles/profile_io_data.cc
@@ -118,7 +118,12 @@
#include "net/ssl/client_cert_store_nss.h"
#endif
+#if defined(OS_ANDROID)
+#include "chrome/browser/android/chromium_application.h"
+#endif // OS_ANDROID
+
#if defined(OS_WIN)
+#include "base/win/metro.h"
#include "net/ssl/client_cert_store_win.h"
#endif
@@ -132,6 +137,10 @@ using content::ResourceContext;
namespace {
+#if defined(OS_WIN)
+bool g_parental_control_on = false;
mmenke 2014/06/17 20:41:44 Why not make this a member of ProfileIOData?
mmenke 2014/06/17 20:44:13 Alternatively, put it in some other file (metro.h?
guohui 2014/06/18 19:36:38 Done.
+#endif // OS_WIN
+
#if defined(DEBUG_DEVTOOLS)
bool IsSupportedDevToolsURL(const GURL& url, base::FilePath* path) {
std::string bundled_path_prefix(chrome::kChromeUIDevToolsBundledPath);
@@ -464,6 +473,10 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) {
}
#endif
+#if defined(OS_WIN)
+ g_parental_control_on = base::win::IsParentalControlActivityLoggingOn();
+#endif // OS_WIN
+
incognito_availibility_pref_.Init(
prefs::kIncognitoModeAvailability, pref_service);
incognito_availibility_pref_.MoveToThread(io_message_loop_proxy);
@@ -752,6 +765,16 @@ bool ProfileIOData::IsOffTheRecord() const {
|| profile_type() == Profile::GUEST_PROFILE;
}
+bool ProfileIOData::ArePlatformParentalControlsEnabledCached() const {
+#if defined(OS_WIN)
+ return g_parental_control_on;
+#elif defined(OS_ANDROID)
+ return chrome::android::ChromiumApplication::AreParentalControlsEnabled();
+#else
+ return false;
+#endif
+}
+
void ProfileIOData::InitializeMetricsEnabledStateOnUIThread() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
#if defined(OS_CHROMEOS)
« no previous file with comments | « chrome/browser/profiles/profile_io_data.h ('k') | chrome/browser/signin/signin_header_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698