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

Unified Diff: base/win/metro.cc

Issue 336213005: Disable incognito link if parental control is on (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moves parental control check to profile_io_data 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
Index: base/win/metro.cc
diff --git a/base/win/metro.cc b/base/win/metro.cc
index 62743c799b56cc1cc12b5985e48595646f1642ab..6684552c5921421fcf4804813962c8f84c197f9a 100644
--- a/base/win/metro.cc
+++ b/base/win/metro.cc
@@ -9,6 +9,13 @@
#include "base/win/scoped_comptr.h"
#include "base/win/windows_version.h"
+namespace {
+
+bool parental_control_logging_required = false;
Bernhard Bauer 2014/06/17 09:15:45 Global (mutable) variables are usually named start
guohui 2014/06/17 18:45:03 Done.
+bool parental_control_status_determined = false;
+
+} // empty namespace
+
namespace base {
namespace win {
@@ -74,18 +81,15 @@ wchar_t* LocalAllocAndCopyString(const string16& src) {
}
bool IsParentalControlActivityLoggingOn() {
- // Query this info on Windows Vista and above.
- if (base::win::GetVersion() < base::win::VERSION_VISTA)
- return false;
-
- static bool parental_control_logging_required = false;
- static bool parental_control_status_determined = false;
-
if (parental_control_status_determined)
return parental_control_logging_required;
parental_control_status_determined = true;
+ // Query this info on Windows Vista and above.
+ if (base::win::GetVersion() < base::win::VERSION_VISTA)
+ return false;
+
ScopedComPtr<IWindowsParentalControlsCore> parent_controls;
HRESULT hr = parent_controls.CreateInstance(
__uuidof(WindowsParentalControls));
@@ -105,6 +109,11 @@ bool IsParentalControlActivityLoggingOn() {
return parental_control_logging_required;
}
+bool IsParentalControlActivityLoggingOnCached() {
+ DCHECK(parental_control_status_determined);
+ return parental_control_logging_required;
+}
+
// Metro driver exports for getting the launch type, initial url, initial
// search term, etc.
extern "C" {

Powered by Google App Engine
This is Rietveld 408576698