| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extensions/extension_system_impl.h" | 5 #include "chrome/browser/extensions/extension_system_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 #include "chrome/browser/notifications/notifier_state_tracker.h" | 60 #include "chrome/browser/notifications/notifier_state_tracker.h" |
| 61 #include "chrome/browser/notifications/notifier_state_tracker_factory.h" | 61 #include "chrome/browser/notifications/notifier_state_tracker_factory.h" |
| 62 #include "ui/message_center/notifier_settings.h" | 62 #include "ui/message_center/notifier_settings.h" |
| 63 #endif | 63 #endif |
| 64 | 64 |
| 65 #if defined(OS_CHROMEOS) | 65 #if defined(OS_CHROMEOS) |
| 66 #include "chrome/browser/app_mode/app_mode_utils.h" | 66 #include "chrome/browser/app_mode/app_mode_utils.h" |
| 67 #include "chrome/browser/chromeos/app_mode/kiosk_app_update_install_gate.h" | 67 #include "chrome/browser/chromeos/app_mode/kiosk_app_update_install_gate.h" |
| 68 #include "chrome/browser/chromeos/extensions/device_local_account_management_pol
icy_provider.h" | 68 #include "chrome/browser/chromeos/extensions/device_local_account_management_pol
icy_provider.h" |
| 69 #include "chrome/browser/chromeos/policy/device_local_account.h" | 69 #include "chrome/browser/chromeos/policy/device_local_account.h" |
| 70 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 70 #include "chromeos/chromeos_switches.h" | 71 #include "chromeos/chromeos_switches.h" |
| 71 #include "chromeos/login/login_state.h" | 72 #include "chromeos/login/login_state.h" |
| 72 #include "components/user_manager/user.h" | 73 #include "components/user_manager/user.h" |
| 73 #include "components/user_manager/user_manager.h" | 74 #include "components/user_manager/user_manager.h" |
| 74 #endif | 75 #endif |
| 75 | 76 |
| 76 using content::BrowserThread; | 77 using content::BrowserThread; |
| 77 | 78 |
| 78 namespace extensions { | 79 namespace extensions { |
| 79 | 80 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 service_worker_manager_.reset(new ServiceWorkerManager(profile_)); | 183 service_worker_manager_.reset(new ServiceWorkerManager(profile_)); |
| 183 | 184 |
| 184 shared_user_script_master_.reset(new SharedUserScriptMaster(profile_)); | 185 shared_user_script_master_.reset(new SharedUserScriptMaster(profile_)); |
| 185 | 186 |
| 186 // ExtensionService depends on RuntimeData. | 187 // ExtensionService depends on RuntimeData. |
| 187 runtime_data_.reset(new RuntimeData(ExtensionRegistry::Get(profile_))); | 188 runtime_data_.reset(new RuntimeData(ExtensionRegistry::Get(profile_))); |
| 188 | 189 |
| 189 bool autoupdate_enabled = !profile_->IsGuestSession() && | 190 bool autoupdate_enabled = !profile_->IsGuestSession() && |
| 190 !profile_->IsSystemProfile(); | 191 !profile_->IsSystemProfile(); |
| 191 #if defined(OS_CHROMEOS) | 192 #if defined(OS_CHROMEOS) |
| 193 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 194 switches::kEnableLoginApps) && |
| 195 chromeos::ProfileHelper::IsSigninProfile(profile_)) { |
| 196 extensions_enabled = true; |
| 197 } |
| 192 if (!extensions_enabled) | 198 if (!extensions_enabled) |
| 193 autoupdate_enabled = false; | 199 autoupdate_enabled = false; |
| 194 #endif // defined(OS_CHROMEOS) | 200 #endif // defined(OS_CHROMEOS) |
| 195 extension_service_.reset(new ExtensionService( | 201 extension_service_.reset(new ExtensionService( |
| 196 profile_, base::CommandLine::ForCurrentProcess(), | 202 profile_, base::CommandLine::ForCurrentProcess(), |
| 197 profile_->GetPath().AppendASCII(extensions::kInstallDirectoryName), | 203 profile_->GetPath().AppendASCII(extensions::kInstallDirectoryName), |
| 198 ExtensionPrefs::Get(profile_), Blacklist::Get(profile_), | 204 ExtensionPrefs::Get(profile_), Blacklist::Get(profile_), |
| 199 autoupdate_enabled, extensions_enabled, &ready_)); | 205 autoupdate_enabled, extensions_enabled, &ready_)); |
| 200 | 206 |
| 201 uninstall_ping_sender_.reset(new UninstallPingSender( | 207 uninstall_ping_sender_.reset(new UninstallPingSender( |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( | 472 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( |
| 467 const std::string& extension_id, | 473 const std::string& extension_id, |
| 468 const UnloadedExtensionInfo::Reason reason) { | 474 const UnloadedExtensionInfo::Reason reason) { |
| 469 BrowserThread::PostTask( | 475 BrowserThread::PostTask( |
| 470 BrowserThread::IO, | 476 BrowserThread::IO, |
| 471 FROM_HERE, | 477 FROM_HERE, |
| 472 base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason)); | 478 base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason)); |
| 473 } | 479 } |
| 474 | 480 |
| 475 } // namespace extensions | 481 } // namespace extensions |
| OLD | NEW |