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 bool go_off_the_record) { | 1204 bool go_off_the_record) { |
1205 TRACE_EVENT0("browser", "ProfileManager::DoFinalInitForServices"); | 1205 TRACE_EVENT0("browser", "ProfileManager::DoFinalInitForServices"); |
1206 | 1206 |
1207 #if BUILDFLAG(ENABLE_EXTENSIONS) | 1207 #if BUILDFLAG(ENABLE_EXTENSIONS) |
1208 // Ensure that the HostContentSettingsMap has been created before the | 1208 // Ensure that the HostContentSettingsMap has been created before the |
1209 // ExtensionSystem is initialized otherwise the ExtensionSystem will be | 1209 // ExtensionSystem is initialized otherwise the ExtensionSystem will be |
1210 // registered twice | 1210 // registered twice |
1211 HostContentSettingsMap* content_settings_map = | 1211 HostContentSettingsMap* content_settings_map = |
1212 HostContentSettingsMapFactory::GetForProfile(profile); | 1212 HostContentSettingsMapFactory::GetForProfile(profile); |
1213 | 1213 |
| 1214 bool extensions_enabled = !go_off_the_record; |
| 1215 #if defined(OS_CHROMEOS) |
| 1216 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1217 switches::kEnableLoginScreenApps) && |
| 1218 chromeos::ProfileHelper::IsSigninProfile(profile)) { |
| 1219 extensions_enabled = true; |
| 1220 } |
| 1221 #endif |
1214 extensions::ExtensionSystem::Get(profile)->InitForRegularProfile( | 1222 extensions::ExtensionSystem::Get(profile)->InitForRegularProfile( |
1215 !go_off_the_record); | 1223 extensions_enabled); |
1216 // During tests, when |profile| is an instance of TestingProfile, | 1224 // During tests, when |profile| is an instance of TestingProfile, |
1217 // ExtensionSystem might not create an ExtensionService. | 1225 // ExtensionSystem might not create an ExtensionService. |
1218 // This block is duplicated in the HostContentSettingsMapFactory | 1226 // This block is duplicated in the HostContentSettingsMapFactory |
1219 // ::BuildServiceInstanceFor method, it should be called once when both the | 1227 // ::BuildServiceInstanceFor method, it should be called once when both the |
1220 // HostContentSettingsMap and the extension_service are set up. | 1228 // HostContentSettingsMap and the extension_service are set up. |
1221 if (extensions::ExtensionSystem::Get(profile)->extension_service()) { | 1229 if (extensions::ExtensionSystem::Get(profile)->extension_service()) { |
1222 extensions::ExtensionSystem::Get(profile)->extension_service()-> | 1230 extensions::ExtensionSystem::Get(profile)->extension_service()-> |
1223 RegisterContentSettings(content_settings_map); | 1231 RegisterContentSettings(content_settings_map); |
1224 } | 1232 } |
1225 // Set the block extensions bit on the ExtensionService. There likely are no | 1233 // Set the block extensions bit on the ExtensionService. There likely are no |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1787 | 1795 |
1788 const base::FilePath new_active_profile_dir = | 1796 const base::FilePath new_active_profile_dir = |
1789 found_entry ? found_entry->GetPath() : GenerateNextProfileDirectoryPath(); | 1797 found_entry ? found_entry->GetPath() : GenerateNextProfileDirectoryPath(); |
1790 FinishDeletingProfile(profile_dir, new_active_profile_dir); | 1798 FinishDeletingProfile(profile_dir, new_active_profile_dir); |
1791 } | 1799 } |
1792 #endif // !defined(OS_ANDROID) | 1800 #endif // !defined(OS_ANDROID) |
1793 | 1801 |
1794 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1802 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
1795 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1803 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
1796 } | 1804 } |
OLD | NEW |