OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "chrome/browser/extensions/extension_sync_service.h" | 30 #include "chrome/browser/extensions/extension_sync_service.h" |
31 #include "chrome/browser/extensions/extension_util.h" | 31 #include "chrome/browser/extensions/extension_util.h" |
32 #include "chrome/browser/extensions/external_install_manager.h" | 32 #include "chrome/browser/extensions/external_install_manager.h" |
33 #include "chrome/browser/extensions/external_provider_impl.h" | 33 #include "chrome/browser/extensions/external_provider_impl.h" |
34 #include "chrome/browser/extensions/install_verifier.h" | 34 #include "chrome/browser/extensions/install_verifier.h" |
35 #include "chrome/browser/extensions/installed_loader.h" | 35 #include "chrome/browser/extensions/installed_loader.h" |
36 #include "chrome/browser/extensions/pending_extension_manager.h" | 36 #include "chrome/browser/extensions/pending_extension_manager.h" |
37 #include "chrome/browser/extensions/permissions_updater.h" | 37 #include "chrome/browser/extensions/permissions_updater.h" |
38 #include "chrome/browser/extensions/shared_module_service.h" | 38 #include "chrome/browser/extensions/shared_module_service.h" |
39 #include "chrome/browser/extensions/unpacked_installer.h" | 39 #include "chrome/browser/extensions/unpacked_installer.h" |
| 40 #include "chrome/browser/extensions/updater/chrome_manifest_fetch_data_delegate.
h" |
40 #include "chrome/browser/extensions/updater/extension_cache.h" | 41 #include "chrome/browser/extensions/updater/extension_cache.h" |
41 #include "chrome/browser/extensions/updater/extension_downloader.h" | 42 #include "chrome/browser/extensions/updater/extension_downloader.h" |
42 #include "chrome/browser/extensions/updater/extension_updater.h" | 43 #include "chrome/browser/extensions/updater/extension_updater.h" |
43 #include "chrome/browser/profiles/profile.h" | 44 #include "chrome/browser/profiles/profile.h" |
44 #include "chrome/browser/signin/profile_identity_provider.h" | 45 #include "chrome/browser/signin/profile_identity_provider.h" |
45 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 46 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
46 #include "chrome/browser/signin/signin_manager_factory.h" | 47 #include "chrome/browser/signin/signin_manager_factory.h" |
47 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 48 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
48 #include "chrome/browser/ui/webui/favicon_source.h" | 49 #include "chrome/browser/ui/webui/favicon_source.h" |
49 #include "chrome/browser/ui/webui/ntp/thumbnail_source.h" | 50 #include "chrome/browser/ui/webui/ntp/thumbnail_source.h" |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 scoped_ptr<ExtensionDownloader> ExtensionService::CreateExtensionDownloader( | 590 scoped_ptr<ExtensionDownloader> ExtensionService::CreateExtensionDownloader( |
590 ExtensionDownloaderDelegate* delegate) { | 591 ExtensionDownloaderDelegate* delegate) { |
591 scoped_ptr<ExtensionDownloader> downloader; | 592 scoped_ptr<ExtensionDownloader> downloader; |
592 #if defined(ENABLE_EXTENSIONS) | 593 #if defined(ENABLE_EXTENSIONS) |
593 scoped_ptr<IdentityProvider> identity_provider = | 594 scoped_ptr<IdentityProvider> identity_provider = |
594 CreateWebstoreIdentityProvider(profile_); | 595 CreateWebstoreIdentityProvider(profile_); |
595 downloader.reset(new ExtensionDownloader( | 596 downloader.reset(new ExtensionDownloader( |
596 delegate, | 597 delegate, |
597 profile_->GetRequestContext())); | 598 profile_->GetRequestContext())); |
598 downloader->SetWebstoreIdentityProvider(identity_provider.Pass()); | 599 downloader->SetWebstoreIdentityProvider(identity_provider.Pass()); |
| 600 downloader->SetManifestFetchDataDelegate( |
| 601 make_scoped_ptr<extensions::ManifestFetchDataDelegate>( |
| 602 new ChromeManifestFetchDataDelegate())); |
599 #endif | 603 #endif |
600 return downloader.Pass(); | 604 return downloader.Pass(); |
601 } | 605 } |
602 | 606 |
603 void ExtensionService::ReloadExtensionImpl( | 607 void ExtensionService::ReloadExtensionImpl( |
604 // "transient" because the process of reloading may cause the reference | 608 // "transient" because the process of reloading may cause the reference |
605 // to become invalid. Instead, use |extension_id|, a copy. | 609 // to become invalid. Instead, use |extension_id|, a copy. |
606 const std::string& transient_extension_id, | 610 const std::string& transient_extension_id, |
607 bool be_noisy) { | 611 bool be_noisy) { |
608 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 612 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
(...skipping 1753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2362 } | 2366 } |
2363 | 2367 |
2364 void ExtensionService::OnProfileDestructionStarted() { | 2368 void ExtensionService::OnProfileDestructionStarted() { |
2365 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2369 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
2366 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2370 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
2367 it != ids_to_unload.end(); | 2371 it != ids_to_unload.end(); |
2368 ++it) { | 2372 ++it) { |
2369 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2373 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
2370 } | 2374 } |
2371 } | 2375 } |
OLD | NEW |