| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1204 TRACE_EVENT0("browser", "ProfileManager::DoFinalInitForServices"); | 1204 TRACE_EVENT0("browser", "ProfileManager::DoFinalInitForServices"); |
| 1205 | 1205 |
| 1206 #if BUILDFLAG(ENABLE_EXTENSIONS) | 1206 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 1207 bool extensions_enabled = !go_off_the_record; | 1207 bool extensions_enabled = !go_off_the_record; |
| 1208 #if defined(OS_CHROMEOS) | 1208 #if defined(OS_CHROMEOS) |
| 1209 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 1209 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1210 switches::kDisableLoginScreenApps) && | 1210 switches::kDisableLoginScreenApps) && |
| 1211 chromeos::ProfileHelper::IsSigninProfile(profile)) { | 1211 chromeos::ProfileHelper::IsSigninProfile(profile)) { |
| 1212 extensions_enabled = true; | 1212 extensions_enabled = true; |
| 1213 } | 1213 } |
| 1214 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1215 chromeos::switches::kEnableLockScreenApps) && |
| 1216 chromeos::ProfileHelper::IsLockScreenAppProfile(profile)) { |
| 1217 extensions_enabled = true; |
| 1218 } |
| 1214 #endif | 1219 #endif |
| 1215 extensions::ExtensionSystem::Get(profile)->InitForRegularProfile( | 1220 extensions::ExtensionSystem::Get(profile)->InitForRegularProfile( |
| 1216 extensions_enabled); | 1221 extensions_enabled); |
| 1217 | 1222 |
| 1218 // Set the block extensions bit on the ExtensionService. There likely are no | 1223 // Set the block extensions bit on the ExtensionService. There likely are no |
| 1219 // blockable extensions to block. | 1224 // blockable extensions to block. |
| 1220 ProfileAttributesEntry* entry; | 1225 ProfileAttributesEntry* entry; |
| 1221 bool has_entry = GetProfileAttributesStorage(). | 1226 bool has_entry = GetProfileAttributesStorage(). |
| 1222 GetProfileAttributesWithPath(profile->GetPath(), &entry); | 1227 GetProfileAttributesWithPath(profile->GetPath(), &entry); |
| 1223 if (has_entry && entry->IsSigninRequired()) { | 1228 if (has_entry && entry->IsSigninRequired()) { |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1602 void ProfileManager::SetNonPersonalProfilePrefs(Profile* profile) { | 1607 void ProfileManager::SetNonPersonalProfilePrefs(Profile* profile) { |
| 1603 PrefService* prefs = profile->GetPrefs(); | 1608 PrefService* prefs = profile->GetPrefs(); |
| 1604 prefs->SetBoolean(prefs::kSigninAllowed, false); | 1609 prefs->SetBoolean(prefs::kSigninAllowed, false); |
| 1605 prefs->SetBoolean(bookmarks::prefs::kEditBookmarksEnabled, false); | 1610 prefs->SetBoolean(bookmarks::prefs::kEditBookmarksEnabled, false); |
| 1606 prefs->SetBoolean(bookmarks::prefs::kShowBookmarkBar, false); | 1611 prefs->SetBoolean(bookmarks::prefs::kShowBookmarkBar, false); |
| 1607 prefs->ClearPref(DefaultSearchManager::kDefaultSearchProviderDataPrefName); | 1612 prefs->ClearPref(DefaultSearchManager::kDefaultSearchProviderDataPrefName); |
| 1608 } | 1613 } |
| 1609 | 1614 |
| 1610 bool ProfileManager::ShouldGoOffTheRecord(Profile* profile) { | 1615 bool ProfileManager::ShouldGoOffTheRecord(Profile* profile) { |
| 1611 #if defined(OS_CHROMEOS) | 1616 #if defined(OS_CHROMEOS) |
| 1612 if (chromeos::ProfileHelper::IsSigninProfile(profile)) | 1617 if (chromeos::ProfileHelper::IsSigninProfile(profile) || |
| 1618 chromeos::ProfileHelper::IsLockScreenAppProfile(profile)) { |
| 1613 return true; | 1619 return true; |
| 1620 } |
| 1614 #endif | 1621 #endif |
| 1615 return profile->IsGuestSession() || profile->IsSystemProfile(); | 1622 return profile->IsGuestSession() || profile->IsSystemProfile(); |
| 1616 } | 1623 } |
| 1617 | 1624 |
| 1618 void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks, | 1625 void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks, |
| 1619 Profile* profile, | 1626 Profile* profile, |
| 1620 Profile::CreateStatus status) { | 1627 Profile::CreateStatus status) { |
| 1621 for (size_t i = 0; i < callbacks.size(); ++i) | 1628 for (size_t i = 0; i < callbacks.size(); ++i) |
| 1622 callbacks[i].Run(profile, status); | 1629 callbacks[i].Run(profile, status); |
| 1623 } | 1630 } |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1761 | 1768 |
| 1762 const base::FilePath new_active_profile_dir = | 1769 const base::FilePath new_active_profile_dir = |
| 1763 found_entry ? found_entry->GetPath() : GenerateNextProfileDirectoryPath(); | 1770 found_entry ? found_entry->GetPath() : GenerateNextProfileDirectoryPath(); |
| 1764 FinishDeletingProfile(profile_dir, new_active_profile_dir); | 1771 FinishDeletingProfile(profile_dir, new_active_profile_dir); |
| 1765 } | 1772 } |
| 1766 #endif // !defined(OS_ANDROID) | 1773 #endif // !defined(OS_ANDROID) |
| 1767 | 1774 |
| 1768 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1775 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
| 1769 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1776 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
| 1770 } | 1777 } |
| OLD | NEW |