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

Side by Side Diff: chrome/browser/profiles/profile_manager.cc

Issue 164333007: Switch guest profile from forced-incognito to UI mods like ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed review comments by msw Created 6 years, 10 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
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/profiles/profile_manager.h" 5 #include "chrome/browser/profiles/profile_manager.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 icon_index, 1100 icon_index,
1101 managed_user_id); 1101 managed_user_id);
1102 1102
1103 if (profile->GetPrefs()->GetBoolean(prefs::kForceEphemeralProfiles)) { 1103 if (profile->GetPrefs()->GetBoolean(prefs::kForceEphemeralProfiles)) {
1104 cache.SetProfileIsEphemeralAtIndex( 1104 cache.SetProfileIsEphemeralAtIndex(
1105 cache.GetIndexOfProfileWithPath(profile->GetPath()), true); 1105 cache.GetIndexOfProfileWithPath(profile->GetPath()), true);
1106 } 1106 }
1107 } 1107 }
1108 1108
1109 void ProfileManager::SetGuestProfilePrefs(Profile* profile) { 1109 void ProfileManager::SetGuestProfilePrefs(Profile* profile) {
1110 // This can be removed in the future but needs to be present through
1111 // a release (or two) so that any existing installs get switched to
1112 // the new state and away from the previous "forced" state.
1110 IncognitoModePrefs::SetAvailability(profile->GetPrefs(), 1113 IncognitoModePrefs::SetAvailability(profile->GetPrefs(),
1111 IncognitoModePrefs::FORCED); 1114 IncognitoModePrefs::ENABLED);
1112 profile->GetPrefs()->SetBoolean(prefs::kShowBookmarkBar, false);
1113 } 1115 }
1114 1116
1115 bool ProfileManager::ShouldGoOffTheRecord(Profile* profile) { 1117 bool ProfileManager::ShouldGoOffTheRecord(Profile* profile) {
1116 bool go_off_the_record = false;
1117 #if defined(OS_CHROMEOS) 1118 #if defined(OS_CHROMEOS)
1118 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 1119 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
1119 if (command_line.HasSwitch(chromeos::switches::kGuestSession) || 1120 if (profile->GetPath().BaseName().value() == chrome::kInitialProfile &&
1120 (profile->GetPath().BaseName().value() == chrome::kInitialProfile && 1121 (!command_line.HasSwitch(switches::kTestType) ||
1121 (!command_line.HasSwitch(switches::kTestType) || 1122 command_line.HasSwitch(chromeos::switches::kLoginProfile))) {
1122 command_line.HasSwitch(chromeos::switches::kLoginProfile)))) { 1123 return true;
1123 go_off_the_record = true;
1124 } 1124 }
1125 #endif 1125 #endif
1126 return go_off_the_record; 1126 return profile->IsGuestSession();
1127 } 1127 }
1128 1128
1129 void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks, 1129 void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks,
1130 Profile* profile, 1130 Profile* profile,
1131 Profile::CreateStatus status) { 1131 Profile::CreateStatus status) {
1132 for (size_t i = 0; i < callbacks.size(); ++i) 1132 for (size_t i = 0; i < callbacks.size(); ++i)
1133 callbacks[i].Run(profile, status); 1133 callbacks[i].Run(profile, status);
1134 } 1134 }
1135 1135
1136 ProfileManager::ProfileInfo::ProfileInfo( 1136 ProfileManager::ProfileInfo::ProfileInfo(
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
1234 last_non_managed_profile_path.BaseName().MaybeAsASCII()); 1234 last_non_managed_profile_path.BaseName().MaybeAsASCII());
1235 FinishDeletingProfile(profile_to_delete_path); 1235 FinishDeletingProfile(profile_to_delete_path);
1236 } 1236 }
1237 } 1237 }
1238 } 1238 }
1239 #endif 1239 #endif
1240 1240
1241 ProfileManagerWithoutInit::ProfileManagerWithoutInit( 1241 ProfileManagerWithoutInit::ProfileManagerWithoutInit(
1242 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { 1242 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) {
1243 } 1243 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_system_impl.cc ('k') | chrome/browser/ui/toolbar/wrench_menu_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698