OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 5 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // Does the work of determining if Windows Parental control activity logging | 101 // Does the work of determining if Windows Parental control activity logging |
102 // is enabled. | 102 // is enabled. |
103 static bool IsParentalControlActivityLoggingOnImpl() { | 103 static bool IsParentalControlActivityLoggingOnImpl() { |
104 base::win::ScopedComPtr<IWindowsParentalControlsCore> parent_controls; | 104 base::win::ScopedComPtr<IWindowsParentalControlsCore> parent_controls; |
105 HRESULT hr = parent_controls.CreateInstance( | 105 HRESULT hr = parent_controls.CreateInstance( |
106 __uuidof(WindowsParentalControls)); | 106 __uuidof(WindowsParentalControls)); |
107 if (FAILED(hr)) | 107 if (FAILED(hr)) |
108 return false; | 108 return false; |
109 | 109 |
110 base::win::ScopedComPtr<IWPCSettings> settings; | 110 base::win::ScopedComPtr<IWPCSettings> settings; |
111 hr = parent_controls->GetUserSettings(nullptr, settings.Receive()); | 111 hr = parent_controls->GetUserSettings(nullptr, settings.GetAddressOf()); |
112 if (FAILED(hr)) | 112 if (FAILED(hr)) |
113 return false; | 113 return false; |
114 | 114 |
115 unsigned long restrictions = 0; | 115 unsigned long restrictions = 0; |
116 settings->GetRestrictions(&restrictions); | 116 settings->GetRestrictions(&restrictions); |
117 | 117 |
118 return (restrictions & WPCFLAG_LOGGING_REQUIRED) == | 118 return (restrictions & WPCFLAG_LOGGING_REQUIRED) == |
119 WPCFLAG_LOGGING_REQUIRED; | 119 WPCFLAG_LOGGING_REQUIRED; |
120 } | 120 } |
121 | 121 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 bool valid = IntToAvailability(pref_value, &result); | 228 bool valid = IntToAvailability(pref_value, &result); |
229 DCHECK(valid); | 229 DCHECK(valid); |
230 if (result != IncognitoModePrefs::DISABLED && | 230 if (result != IncognitoModePrefs::DISABLED && |
231 mode == CHECK_PARENTAL_CONTROLS && ArePlatformParentalControlsEnabled()) { | 231 mode == CHECK_PARENTAL_CONTROLS && ArePlatformParentalControlsEnabled()) { |
232 if (result == IncognitoModePrefs::FORCED) | 232 if (result == IncognitoModePrefs::FORCED) |
233 LOG(ERROR) << "Ignoring FORCED incognito. Parental control logging on"; | 233 LOG(ERROR) << "Ignoring FORCED incognito. Parental control logging on"; |
234 return IncognitoModePrefs::DISABLED; | 234 return IncognitoModePrefs::DISABLED; |
235 } | 235 } |
236 return result; | 236 return result; |
237 } | 237 } |
OLD | NEW |