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 "apps/app_restore_service.h" | |
10 #include "apps/app_restore_service_factory.h" | |
11 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
12 #include "base/bind.h" | 10 #include "base/bind.h" |
13 #include "base/command_line.h" | 11 #include "base/command_line.h" |
14 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
15 #include "base/files/file_util.h" | 13 #include "base/files/file_util.h" |
16 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
17 #include "base/strings/string_tokenizer.h" | 15 #include "base/strings/string_tokenizer.h" |
18 #include "base/trace_event/trace_event.h" | 16 #include "base/trace_event/trace_event.h" |
19 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 18 #include "chrome/browser/apps/browser_context_keyed_service_factories.h" |
20 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
21 #include "chrome/browser/chrome_notification_types.h" | 20 #include "chrome/browser/chrome_notification_types.h" |
22 #include "chrome/browser/extensions/chrome_app_sorting.h" | 21 #include "chrome/browser/extensions/chrome_app_sorting.h" |
23 #include "chrome/browser/extensions/chrome_content_verifier_delegate.h" | 22 #include "chrome/browser/extensions/chrome_content_verifier_delegate.h" |
24 #include "chrome/browser/extensions/component_loader.h" | 23 #include "chrome/browser/extensions/component_loader.h" |
25 #include "chrome/browser/extensions/extension_error_reporter.h" | 24 #include "chrome/browser/extensions/extension_error_reporter.h" |
26 #include "chrome/browser/extensions/extension_garbage_collector.h" | 25 #include "chrome/browser/extensions/extension_garbage_collector.h" |
27 #include "chrome/browser/extensions/extension_management.h" | 26 #include "chrome/browser/extensions/extension_management.h" |
28 #include "chrome/browser/extensions/extension_service.h" | 27 #include "chrome/browser/extensions/extension_service.h" |
29 #include "chrome/browser/extensions/extension_sync_service.h" | 28 #include "chrome/browser/extensions/extension_sync_service.h" |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 | 327 |
329 ContentVerifier* ExtensionSystemImpl::Shared::content_verifier() { | 328 ContentVerifier* ExtensionSystemImpl::Shared::content_verifier() { |
330 return content_verifier_.get(); | 329 return content_verifier_.get(); |
331 } | 330 } |
332 | 331 |
333 void ExtensionSystemImpl::Shared::Observe( | 332 void ExtensionSystemImpl::Shared::Observe( |
334 int type, | 333 int type, |
335 const content::NotificationSource& source, | 334 const content::NotificationSource& source, |
336 const content::NotificationDetails& details) { | 335 const content::NotificationDetails& details) { |
337 DCHECK_EQ(chrome::NOTIFICATION_APP_TERMINATING, type); | 336 DCHECK_EQ(chrome::NOTIFICATION_APP_TERMINATING, type); |
338 CHECK(apps::AppRestoreServiceFactory::GetForBrowserContext(profile_)); | 337 chrome_apps::NotifyApplicationTerminating(profile_); |
339 apps::AppRestoreServiceFactory::GetForBrowserContext(profile_) | |
340 ->OnApplicationTerminating(); | |
341 } | 338 } |
342 | 339 |
343 // | 340 // |
344 // ExtensionSystemImpl | 341 // ExtensionSystemImpl |
345 // | 342 // |
346 | 343 |
347 ExtensionSystemImpl::ExtensionSystemImpl(Profile* profile) | 344 ExtensionSystemImpl::ExtensionSystemImpl(Profile* profile) |
348 : profile_(profile) { | 345 : profile_(profile) { |
349 shared_ = ExtensionSystemSharedFactory::GetForBrowserContext(profile); | 346 shared_ = ExtensionSystemSharedFactory::GetForBrowserContext(profile); |
350 | 347 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( | 460 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( |
464 const std::string& extension_id, | 461 const std::string& extension_id, |
465 const UnloadedExtensionInfo::Reason reason) { | 462 const UnloadedExtensionInfo::Reason reason) { |
466 BrowserThread::PostTask( | 463 BrowserThread::PostTask( |
467 BrowserThread::IO, | 464 BrowserThread::IO, |
468 FROM_HERE, | 465 FROM_HERE, |
469 base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason)); | 466 base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason)); |
470 } | 467 } |
471 | 468 |
472 } // namespace extensions | 469 } // namespace extensions |
OLD | NEW |