Chromium Code Reviews| 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" { |