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 | 9 |
10 class CommandLine; | 10 class CommandLine; |
11 class PrefService; | 11 class PrefService; |
| 12 class Profile; |
12 | 13 |
13 namespace user_prefs { | 14 namespace user_prefs { |
14 class PrefRegistrySyncable; | 15 class PrefRegistrySyncable; |
15 } | 16 } |
16 | 17 |
17 // Specifies Incognito mode availability preferences. | 18 // Specifies Incognito mode availability preferences. |
18 class IncognitoModePrefs { | 19 class IncognitoModePrefs { |
19 public: | 20 public: |
20 // Possible values for Incognito mode availability. Please, do not change | 21 // Possible values for Incognito mode availability. Please, do not change |
21 // the order of entries since numeric values are exposed to users. | 22 // the order of entries since numeric values are exposed to users. |
(...skipping 25 matching lines...) Expand all Loading... |
47 | 48 |
48 // Converts in_value into the corresponding Availability value. Returns true | 49 // Converts in_value into the corresponding Availability value. Returns true |
49 // if conversion is successful (in_value is valid). Otherwise, returns false | 50 // if conversion is successful (in_value is valid). Otherwise, returns false |
50 // and *out_value is set to ENABLED. | 51 // and *out_value is set to ENABLED. |
51 static bool IntToAvailability(int in_value, Availability* out_value); | 52 static bool IntToAvailability(int in_value, Availability* out_value); |
52 | 53 |
53 // Returns true if the browser should start in incognito mode. | 54 // Returns true if the browser should start in incognito mode. |
54 static bool ShouldLaunchIncognito(const CommandLine& command_line, | 55 static bool ShouldLaunchIncognito(const CommandLine& command_line, |
55 const PrefService* prefs); | 56 const PrefService* prefs); |
56 | 57 |
| 58 // Returns true if |profile| can open a new Browser. This checks the incognito |
| 59 // availability policies and verifies if the |profile| type is allowed to |
| 60 // open new windows. |
| 61 static bool CanOpenBrowser(Profile* profile); |
| 62 |
57 private: | 63 private: |
58 DISALLOW_IMPLICIT_CONSTRUCTORS(IncognitoModePrefs); | 64 DISALLOW_IMPLICIT_CONSTRUCTORS(IncognitoModePrefs); |
59 }; | 65 }; |
60 | 66 |
61 #endif // CHROME_BROWSER_PREFS_INCOGNITO_MODE_PREFS_H_ | 67 #endif // CHROME_BROWSER_PREFS_INCOGNITO_MODE_PREFS_H_ |
OLD | NEW |