Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_PREFS_INCOGNITO_MODE_PREFS_H_ | |
| 6 #define CHROME_BROWSER_PREFS_INCOGNITO_MODE_PREFS_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 class PrefService; | |
| 10 | |
| 11 // Specifies Incognito mode availability preferences. | |
| 12 class IncognitoModePrefs { | |
| 13 public: | |
| 14 // Possible values for Incognito mode availability. Please, do not change | |
| 15 // the order of entries since numeric values are exposed to users. | |
| 16 enum Availability { | |
| 17 // Incognito mode enabled. Users may open pages in both Incognito mode and | |
| 18 // normal mode (the default behaviour). | |
| 19 ENABLED = 0, | |
| 20 // Incognito mode disabled. Users may not open pages in Incognito mode. | |
| 21 // Only normal mode is available for browsing. | |
| 22 DISABLED, | |
| 23 // Incognito mode forced. Users may open pages *ONLY* in Incognito mode. | |
| 24 // Normal mode is not available for browsing. | |
| 25 FORCED, | |
| 26 | |
| 27 AVAILABILITY_NUM_TYPES | |
| 28 }; | |
| 29 | |
| 30 // Register incognito related preferences. | |
| 31 static void RegisterUserPrefs(PrefService* prefs); | |
| 32 | |
| 33 // Returns kIncognitoModeAvailability preference value stored | |
| 34 // in the given pref service. | |
| 35 static Availability GetAvailability(const PrefService* prefs); | |
| 36 | |
| 37 // Converts in_value into the corresponding Availability value. Returns true | |
| 38 // if conversion is successful (in_value is valid). Otherwise, returns false | |
| 39 // and *out_value is set to ENABLED. | |
| 40 static bool IntToAvailability(int in_value, Availability* out_value); | |
| 41 | |
| 42 ~IncognitoModePrefs(); | |
| 43 private: | |
| 44 IncognitoModePrefs(); | |
|
Bernhard Bauer
2011/07/29 09:11:46
DISALLOW_IMPLICIT_CONSTRUCTORS? And I think there
rustema
2011/07/30 06:17:37
Done.
| |
| 45 }; | |
| 46 | |
| 47 #endif // CHROME_BROWSER_PREFS_INCOGNITO_MODE_PREFS_H_ | |
| OLD | NEW |