| 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 "base/threading/thread_restrictions.h" | 10 #include "base/threading/thread_restrictions.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 91 |
| 92 // static | 92 // static |
| 93 void IncognitoModePrefs::SetAvailability(PrefService* prefs, | 93 void IncognitoModePrefs::SetAvailability(PrefService* prefs, |
| 94 const Availability availability) { | 94 const Availability availability) { |
| 95 prefs->SetInteger(prefs::kIncognitoModeAvailability, availability); | 95 prefs->SetInteger(prefs::kIncognitoModeAvailability, availability); |
| 96 } | 96 } |
| 97 | 97 |
| 98 // static | 98 // static |
| 99 void IncognitoModePrefs::RegisterProfilePrefs( | 99 void IncognitoModePrefs::RegisterProfilePrefs( |
| 100 user_prefs::PrefRegistrySyncable* registry) { | 100 user_prefs::PrefRegistrySyncable* registry) { |
| 101 registry->RegisterIntegerPref( | 101 registry->RegisterIntegerPref(prefs::kIncognitoModeAvailability, |
| 102 prefs::kIncognitoModeAvailability, | 102 IncognitoModePrefs::ENABLED); |
| 103 IncognitoModePrefs::ENABLED, | |
| 104 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 105 } | 103 } |
| 106 | 104 |
| 107 // static | 105 // static |
| 108 bool IncognitoModePrefs::ShouldLaunchIncognito( | 106 bool IncognitoModePrefs::ShouldLaunchIncognito( |
| 109 const base::CommandLine& command_line, | 107 const base::CommandLine& command_line, |
| 110 const PrefService* prefs) { | 108 const PrefService* prefs) { |
| 111 Availability incognito_avail = GetAvailability(prefs); | 109 Availability incognito_avail = GetAvailability(prefs); |
| 112 return incognito_avail != IncognitoModePrefs::DISABLED && | 110 return incognito_avail != IncognitoModePrefs::DISABLED && |
| 113 (command_line.HasSwitch(switches::kIncognito) || | 111 (command_line.HasSwitch(switches::kIncognito) || |
| 114 incognito_avail == IncognitoModePrefs::FORCED); | 112 incognito_avail == IncognitoModePrefs::FORCED); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 } | 156 } |
| 159 return parental_controls_state == | 157 return parental_controls_state == |
| 160 ParentalControlsState::ACTIVITY_LOGGING_ENABLED; | 158 ParentalControlsState::ACTIVITY_LOGGING_ENABLED; |
| 161 #elif defined(OS_ANDROID) | 159 #elif defined(OS_ANDROID) |
| 162 return chrome::android::ChromiumApplication::AreParentalControlsEnabled(); | 160 return chrome::android::ChromiumApplication::AreParentalControlsEnabled(); |
| 163 #else | 161 #else |
| 164 return false; | 162 return false; |
| 165 #endif | 163 #endif |
| 166 } | 164 } |
| 167 | 165 |
| OLD | NEW |