Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1275)

Unified Diff: chrome/browser/extensions/extension_system_impl.cc

Issue 1890163004: extensions: Abstract out install delay strategy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: for comments in #4 Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extension_system_impl.h ('k') | chrome/browser/extensions/install_gate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_system_impl.cc
diff --git a/chrome/browser/extensions/extension_system_impl.cc b/chrome/browser/extensions/extension_system_impl.cc
index 1a04022fd930d35a32b61799a4787d3f96cedf1a..1fd0800fc2d15352d54637781a7129c579c1ee3d 100644
--- a/chrome/browser/extensions/extension_system_impl.cc
+++ b/chrome/browser/extensions/extension_system_impl.cc
@@ -20,6 +20,7 @@
#include "chrome/browser/extensions/chrome_content_verifier_delegate.h"
#include "chrome/browser/extensions/component_loader.h"
#include "chrome/browser/extensions/extension_error_reporter.h"
+#include "chrome/browser/extensions/extension_garbage_collector.h"
#include "chrome/browser/extensions/extension_management.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_sync_service.h"
@@ -31,6 +32,7 @@
#include "chrome/browser/extensions/shared_user_script_master.h"
#include "chrome/browser/extensions/state_store_notification_observer.h"
#include "chrome/browser/extensions/unpacked_installer.h"
+#include "chrome/browser/extensions/update_install_gate.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/webui/extensions/extension_icon_source.h"
@@ -142,6 +144,18 @@ void ExtensionSystemImpl::Shared::RegisterManagementPolicyProviders() {
management_policy_->RegisterProvider(InstallVerifier::Get(profile_));
}
+void ExtensionSystemImpl::Shared::InitInstallGates() {
+ update_install_gate_.reset(new UpdateInstallGate(extension_service_.get()));
+ extension_service_->RegisterInstallGate(
+ ExtensionPrefs::DELAY_REASON_WAIT_FOR_IDLE, update_install_gate_.get());
+ extension_service_->RegisterInstallGate(
+ ExtensionPrefs::DELAY_REASON_GC,
+ ExtensionGarbageCollector::Get(profile_));
+ extension_service_->RegisterInstallGate(
+ ExtensionPrefs::DELAY_REASON_WAIT_FOR_IMPORTS,
+ extension_service_->shared_module_service());
+}
+
void ExtensionSystemImpl::Shared::Init(bool extensions_enabled) {
TRACE_EVENT0("browser,startup", "ExtensionSystemImpl::Shared::Init");
const base::CommandLine* command_line =
@@ -227,6 +241,8 @@ void ExtensionSystemImpl::Shared::Init(bool extensions_enabled) {
app_sorting_.reset(new ChromeAppSorting(profile_));
+ InitInstallGates();
+
extension_service_->Init();
// Make sure ExtensionSyncService is created.
« no previous file with comments | « chrome/browser/extensions/extension_system_impl.h ('k') | chrome/browser/extensions/install_gate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698