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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 return result; | 47 return result; |
48 } | 48 } |
49 | 49 |
50 // static | 50 // static |
51 void IncognitoModePrefs::SetAvailability(PrefService* prefs, | 51 void IncognitoModePrefs::SetAvailability(PrefService* prefs, |
52 const Availability availability) { | 52 const Availability availability) { |
53 prefs->SetInteger(prefs::kIncognitoModeAvailability, availability); | 53 prefs->SetInteger(prefs::kIncognitoModeAvailability, availability); |
54 } | 54 } |
55 | 55 |
56 // static | 56 // static |
57 void IncognitoModePrefs::RegisterUserPrefs( | 57 void IncognitoModePrefs::RegisterProfilePrefs( |
58 user_prefs::PrefRegistrySyncable* registry) { | 58 user_prefs::PrefRegistrySyncable* registry) { |
59 registry->RegisterIntegerPref( | 59 registry->RegisterIntegerPref( |
60 prefs::kIncognitoModeAvailability, | 60 prefs::kIncognitoModeAvailability, |
61 IncognitoModePrefs::ENABLED, | 61 IncognitoModePrefs::ENABLED, |
62 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 62 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
63 } | 63 } |
64 | 64 |
65 // static | 65 // static |
66 bool IncognitoModePrefs::ShouldLaunchIncognito( | 66 bool IncognitoModePrefs::ShouldLaunchIncognito( |
67 const CommandLine& command_line, | 67 const CommandLine& command_line, |
(...skipping 12 matching lines...) Expand all Loading... |
80 case IncognitoModePrefs::DISABLED: | 80 case IncognitoModePrefs::DISABLED: |
81 return !profile->IsOffTheRecord(); | 81 return !profile->IsOffTheRecord(); |
82 case IncognitoModePrefs::FORCED: | 82 case IncognitoModePrefs::FORCED: |
83 return profile->IsOffTheRecord(); | 83 return profile->IsOffTheRecord(); |
84 case IncognitoModePrefs::AVAILABILITY_NUM_TYPES: | 84 case IncognitoModePrefs::AVAILABILITY_NUM_TYPES: |
85 NOTREACHED(); | 85 NOTREACHED(); |
86 } | 86 } |
87 NOTREACHED(); | 87 NOTREACHED(); |
88 return false; | 88 return false; |
89 } | 89 } |
OLD | NEW |