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

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

Issue 496713003: Guest session operates irrespective of IncognitoModePrefs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rewrite the DCHECK Created 6 years, 4 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/profiles/off_the_record_profile_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 const CommandLine& command_line, 75 const 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())
86 return true;
87
85 switch (GetAvailability(profile->GetPrefs())) { 88 switch (GetAvailability(profile->GetPrefs())) {
86 case IncognitoModePrefs::ENABLED: 89 case IncognitoModePrefs::ENABLED:
87 return true; 90 return true;
88 91
89 case IncognitoModePrefs::DISABLED: 92 case IncognitoModePrefs::DISABLED:
90 return !profile->IsOffTheRecord(); 93 return !profile->IsOffTheRecord();
91 94
92 case IncognitoModePrefs::FORCED: 95 case IncognitoModePrefs::FORCED:
93 return profile->IsOffTheRecord(); 96 return profile->IsOffTheRecord();
94 97
(...skipping 25 matching lines...) Expand all
120 bool IncognitoModePrefs::ArePlatformParentalControlsEnabledCached() { 123 bool IncognitoModePrefs::ArePlatformParentalControlsEnabledCached() {
121 #if defined(OS_WIN) 124 #if defined(OS_WIN)
122 return g_parental_control_on; 125 return g_parental_control_on;
123 #elif defined(OS_ANDROID) 126 #elif defined(OS_ANDROID)
124 return chrome::android::ChromiumApplication::AreParentalControlsEnabled(); 127 return chrome::android::ChromiumApplication::AreParentalControlsEnabled();
125 #else 128 #else
126 return false; 129 return false;
127 #endif 130 #endif
128 } 131 }
129 132
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/profiles/off_the_record_profile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698