| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 void IncognitoModePrefs::RegisterProfilePrefs( | 65 void IncognitoModePrefs::RegisterProfilePrefs( |
| 66 user_prefs::PrefRegistrySyncable* registry) { | 66 user_prefs::PrefRegistrySyncable* registry) { |
| 67 registry->RegisterIntegerPref( | 67 registry->RegisterIntegerPref( |
| 68 prefs::kIncognitoModeAvailability, | 68 prefs::kIncognitoModeAvailability, |
| 69 IncognitoModePrefs::ENABLED, | 69 IncognitoModePrefs::ENABLED, |
| 70 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 70 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 71 } | 71 } |
| 72 | 72 |
| 73 // static | 73 // static |
| 74 bool IncognitoModePrefs::ShouldLaunchIncognito( | 74 bool IncognitoModePrefs::ShouldLaunchIncognito( |
| 75 const CommandLine& command_line, | 75 const base::CommandLine& command_line, |
| 76 const PrefService* prefs) { | 76 const PrefService* prefs) { |
| 77 Availability incognito_avail = GetAvailability(prefs); | 77 Availability incognito_avail = GetAvailability(prefs); |
| 78 return incognito_avail != IncognitoModePrefs::DISABLED && | 78 return incognito_avail != IncognitoModePrefs::DISABLED && |
| 79 (command_line.HasSwitch(switches::kIncognito) || | 79 (command_line.HasSwitch(switches::kIncognito) || |
| 80 incognito_avail == IncognitoModePrefs::FORCED); | 80 incognito_avail == IncognitoModePrefs::FORCED); |
| 81 } | 81 } |
| 82 | 82 |
| 83 // static | 83 // static |
| 84 bool IncognitoModePrefs::CanOpenBrowser(Profile* profile) { | 84 bool IncognitoModePrefs::CanOpenBrowser(Profile* profile) { |
| 85 if (profile->IsGuestSession()) | 85 if (profile->IsGuestSession()) |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 bool IncognitoModePrefs::ArePlatformParentalControlsEnabledCached() { | 123 bool IncognitoModePrefs::ArePlatformParentalControlsEnabledCached() { |
| 124 #if defined(OS_WIN) | 124 #if defined(OS_WIN) |
| 125 return g_parental_control_on; | 125 return g_parental_control_on; |
| 126 #elif defined(OS_ANDROID) | 126 #elif defined(OS_ANDROID) |
| 127 return chrome::android::ChromiumApplication::AreParentalControlsEnabled(); | 127 return chrome::android::ChromiumApplication::AreParentalControlsEnabled(); |
| 128 #else | 128 #else |
| 129 return false; | 129 return false; |
| 130 #endif | 130 #endif |
| 131 } | 131 } |
| 132 | 132 |
| OLD | NEW |