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/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 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1093 void ProfileManager::SetGuestProfilePrefs(Profile* profile) { | 1093 void ProfileManager::SetGuestProfilePrefs(Profile* profile) { |
1094 IncognitoModePrefs::SetAvailability(profile->GetPrefs(), | 1094 IncognitoModePrefs::SetAvailability(profile->GetPrefs(), |
1095 IncognitoModePrefs::FORCED); | 1095 IncognitoModePrefs::FORCED); |
1096 profile->GetPrefs()->SetBoolean(prefs::kShowBookmarkBar, false); | 1096 profile->GetPrefs()->SetBoolean(prefs::kShowBookmarkBar, false); |
1097 } | 1097 } |
1098 | 1098 |
1099 bool ProfileManager::ShouldGoOffTheRecord(Profile* profile) { | 1099 bool ProfileManager::ShouldGoOffTheRecord(Profile* profile) { |
1100 bool go_off_the_record = false; | 1100 bool go_off_the_record = false; |
1101 #if defined(OS_CHROMEOS) | 1101 #if defined(OS_CHROMEOS) |
1102 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 1102 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
1103 if (profile->GetPath().BaseName().value() == chrome::kInitialProfile && | 1103 if (command_line.HasSwitch(chromeos::switches::kGuestSession) || |
1104 (!command_line.HasSwitch(switches::kTestType) || | 1104 (profile->GetPath().BaseName().value() == chrome::kInitialProfile && |
1105 command_line.HasSwitch(chromeos::switches::kLoginProfile))) { | 1105 (!command_line.HasSwitch(switches::kTestType) || |
1106 command_line.HasSwitch(chromeos::switches::kLoginProfile)))) { | |
miket_OOO
2013/12/20 18:59:02
This code is getting pretty tricky. What do you th
Dmitry Polukhin
2013/12/20 21:55:54
It looks like creating test is not easy task becau
| |
1106 go_off_the_record = true; | 1107 go_off_the_record = true; |
1107 } | 1108 } |
1108 #endif | 1109 #endif |
1109 return go_off_the_record; | 1110 return go_off_the_record; |
1110 } | 1111 } |
1111 | 1112 |
1112 void ProfileManager::ScheduleProfileForDeletion( | 1113 void ProfileManager::ScheduleProfileForDeletion( |
1113 const base::FilePath& profile_dir, | 1114 const base::FilePath& profile_dir, |
1114 const CreateCallback& callback) { | 1115 const CreateCallback& callback) { |
1115 DCHECK(profiles::IsMultipleProfilesEnabled()); | 1116 DCHECK(profiles::IsMultipleProfilesEnabled()); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1279 ProfileManager::ProfileInfo::ProfileInfo( | 1280 ProfileManager::ProfileInfo::ProfileInfo( |
1280 Profile* profile, | 1281 Profile* profile, |
1281 bool created) | 1282 bool created) |
1282 : profile(profile), | 1283 : profile(profile), |
1283 created(created) { | 1284 created(created) { |
1284 } | 1285 } |
1285 | 1286 |
1286 ProfileManager::ProfileInfo::~ProfileInfo() { | 1287 ProfileManager::ProfileInfo::~ProfileInfo() { |
1287 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release()); | 1288 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release()); |
1288 } | 1289 } |
OLD | NEW |