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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 return false; | 194 return false; |
195 } | 195 } |
196 } | 196 } |
197 | 197 |
198 #if defined(OS_WIN) | 198 #if defined(OS_WIN) |
199 // static | 199 // static |
200 void IncognitoModePrefs::InitializePlatformParentalControls() { | 200 void IncognitoModePrefs::InitializePlatformParentalControls() { |
201 // TODO(fdoray): This task uses COM. Add the WithCom() trait once supported. | 201 // TODO(fdoray): This task uses COM. Add the WithCom() trait once supported. |
202 // crbug.com/662122 | 202 // crbug.com/662122 |
203 base::PostTaskWithTraits( | 203 base::PostTaskWithTraits( |
204 FROM_HERE, base::TaskTraits().MayBlock().WithPriority( | 204 FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE}, |
205 base::TaskPriority::USER_VISIBLE), | |
206 base::Bind( | 205 base::Bind( |
207 base::IgnoreResult(&PlatformParentalControlsValue::GetInstance))); | 206 base::IgnoreResult(&PlatformParentalControlsValue::GetInstance))); |
208 } | 207 } |
209 #endif | 208 #endif |
210 | 209 |
211 // static | 210 // static |
212 bool IncognitoModePrefs::ArePlatformParentalControlsEnabled() { | 211 bool IncognitoModePrefs::ArePlatformParentalControlsEnabled() { |
213 #if defined(OS_WIN) | 212 #if defined(OS_WIN) |
214 return PlatformParentalControlsValue::GetInstance()->is_enabled(); | 213 return PlatformParentalControlsValue::GetInstance()->is_enabled(); |
215 #elif defined(OS_ANDROID) | 214 #elif defined(OS_ANDROID) |
(...skipping 13 matching lines...) Expand all Loading... |
229 bool valid = IntToAvailability(pref_value, &result); | 228 bool valid = IntToAvailability(pref_value, &result); |
230 DCHECK(valid); | 229 DCHECK(valid); |
231 if (result != IncognitoModePrefs::DISABLED && | 230 if (result != IncognitoModePrefs::DISABLED && |
232 mode == CHECK_PARENTAL_CONTROLS && ArePlatformParentalControlsEnabled()) { | 231 mode == CHECK_PARENTAL_CONTROLS && ArePlatformParentalControlsEnabled()) { |
233 if (result == IncognitoModePrefs::FORCED) | 232 if (result == IncognitoModePrefs::FORCED) |
234 LOG(ERROR) << "Ignoring FORCED incognito. Parental control logging on"; | 233 LOG(ERROR) << "Ignoring FORCED incognito. Parental control logging on"; |
235 return IncognitoModePrefs::DISABLED; | 234 return IncognitoModePrefs::DISABLED; |
236 } | 235 } |
237 return result; | 236 return result; |
238 } | 237 } |
OLD | NEW |