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

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

Issue 15947007: Move application restart and relaunch code out of ExtensionService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pafooey Created 7 years, 7 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
Index: chrome/browser/extensions/unpacked_installer.cc
diff --git a/chrome/browser/extensions/unpacked_installer.cc b/chrome/browser/extensions/unpacked_installer.cc
index 1eeabf27a58500d16ba242c9b68900ffdbb4e0ae..0d73ed65821cef736c39669266548202dc68a0ec 100644
--- a/chrome/browser/extensions/unpacked_installer.cc
+++ b/chrome/browser/extensions/unpacked_installer.cc
@@ -95,7 +95,6 @@ UnpackedInstaller::UnpackedInstaller(ExtensionService* extension_service)
: service_weak_(extension_service->AsWeakPtr()),
prompt_for_plugins_(true),
require_modern_manifest_version_(true),
- launch_on_load_(false),
installer_(extension_service->profile()) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}
@@ -114,13 +113,13 @@ void UnpackedInstaller::Load(const base::FilePath& path_in) {
base::Bind(&UnpackedInstaller::GetAbsolutePath, this));
}
-void UnpackedInstaller::LoadFromCommandLine(const base::FilePath& path_in,
- bool launch_on_load) {
+bool UnpackedInstaller::LoadFromCommandLine(const base::FilePath& path_in,
+ std::string* extension_id) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(extension_path_.empty());
if (!service_weak_)
- return;
+ return false;
// Load extensions from the command line synchronously to avoid a race
// between extension loading and loading an URL from the command line.
base::ThreadRestrictions::ScopedAllowIO allow_io;
@@ -129,7 +128,7 @@ void UnpackedInstaller::LoadFromCommandLine(const base::FilePath& path_in,
if (!IsLoadingUnpackedAllowed()) {
ReportExtensionLoadError(kUnpackedExtensionsBlacklistedError);
- return;
+ return false;
}
std::string error;
@@ -141,12 +140,13 @@ void UnpackedInstaller::LoadFromCommandLine(const base::FilePath& path_in,
if (!installer_.extension()) {
ReportExtensionLoadError(error);
- return;
+ return false;
}
- launch_on_load_ = launch_on_load;
-
ShowInstallPrompt();
+
+ *extension_id = installer_.extension()->id();
+ return true;
}
void UnpackedInstaller::ShowInstallPrompt() {
@@ -281,9 +281,6 @@ void UnpackedInstaller::ConfirmInstall() {
PermissionsUpdater perms_updater(service_weak_->profile());
perms_updater.GrantActivePermissions(installer_.extension());
- if (launch_on_load_)
- service_weak_->ScheduleLaunchOnLoad(installer_.extension()->id());
-
service_weak_->OnExtensionInstalled(
installer_.extension(),
syncer::StringOrdinal(),
« no previous file with comments | « chrome/browser/extensions/unpacked_installer.h ('k') | chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698