Chromium Code Reviews| 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 #ifndef CHROME_BROWSER_PREFS_INCOGNITO_MODE_PREFS_H_ | 5 #ifndef CHROME_BROWSER_PREFS_INCOGNITO_MODE_PREFS_H_ |
| 6 #define CHROME_BROWSER_PREFS_INCOGNITO_MODE_PREFS_H_ | 6 #define CHROME_BROWSER_PREFS_INCOGNITO_MODE_PREFS_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | |
| 9 | 10 |
| 10 class PrefService; | 11 class PrefService; |
| 11 class Profile; | 12 class Profile; |
| 12 | 13 |
| 13 namespace base { | 14 namespace base { |
| 14 class CommandLine; | 15 class CommandLine; |
| 15 } | 16 } |
| 16 | 17 |
| 17 namespace user_prefs { | 18 namespace user_prefs { |
| 18 class PrefRegistrySyncable; | 19 class PrefRegistrySyncable; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 // Returns true if the browser should start in incognito mode. | 58 // Returns true if the browser should start in incognito mode. |
| 58 static bool ShouldLaunchIncognito(const base::CommandLine& command_line, | 59 static bool ShouldLaunchIncognito(const base::CommandLine& command_line, |
| 59 const PrefService* prefs); | 60 const PrefService* prefs); |
| 60 | 61 |
| 61 // Returns true if |profile| can open a new Browser. This checks the incognito | 62 // Returns true if |profile| can open a new Browser. This checks the incognito |
| 62 // availability policies and verifies if the |profile| type is allowed to | 63 // availability policies and verifies if the |profile| type is allowed to |
| 63 // open new windows. | 64 // open new windows. |
| 64 static bool CanOpenBrowser(Profile* profile); | 65 static bool CanOpenBrowser(Profile* profile); |
| 65 | 66 |
| 66 // Returns whether parental controls have been enabled on the platform. This | 67 // Returns whether parental controls have been enabled on the platform. This |
| 67 // method simply returns a cached value and thus the result may be stale. May | 68 // method evaluates and caches if the platform controls have been enabled on |
| 68 // be called on any thread. | 69 // the first call, which must be on the UI thread when IO and blocking are |
| 69 static bool ArePlatformParentalControlsEnabledCached(); | 70 // allowed. Subsequent calls may be from any thread. |
|
gab
2015/03/04 19:21:20
Also mention that this must be called on the main
| |
| 70 | 71 static bool ArePlatformParentalControlsEnabled() WARN_UNUSED_RESULT; |
| 71 #if defined(OS_WIN) | |
| 72 // Initializes the parental control settings. Must be called on UI thread and | |
| 73 // before |ArePlatformParentalControlsEnabled|. | |
| 74 static void InitializePlatformParentalControls(); | |
| 75 #endif // OS_WIN | |
| 76 | 72 |
| 77 private: | 73 private: |
| 78 // Returns whether parental controls have been enabled on the platform, which | |
| 79 // if enabled will overrule the Availability as configured in prefs. | |
| 80 static bool ArePlatformParentalControlsEnabled(); | |
| 81 | |
| 82 DISALLOW_IMPLICIT_CONSTRUCTORS(IncognitoModePrefs); | 74 DISALLOW_IMPLICIT_CONSTRUCTORS(IncognitoModePrefs); |
| 83 }; | 75 }; |
| 84 | 76 |
| 85 #endif // CHROME_BROWSER_PREFS_INCOGNITO_MODE_PREFS_H_ | 77 #endif // CHROME_BROWSER_PREFS_INCOGNITO_MODE_PREFS_H_ |
| OLD | NEW |