Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Side by Side Diff: chrome/browser/prefs/incognito_mode_prefs.cc

Issue 816403003: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/prefs/command_line_pref_store_unittest.cc ('k') | chrome/browser/prefs/pref_service_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698