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

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

Issue 412043003: Make --install-chrome-app use extensions::WebstoreInstallWithPrompt. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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/startup_helper.cc
diff --git a/chrome/browser/extensions/startup_helper.cc b/chrome/browser/extensions/startup_helper.cc
index 4074b5f7c849ac6145256c68fb78777493b9e84e..66c8ff155e2e86465e37c38d57f19a63a74bbd40 100644
--- a/chrome/browser/extensions/startup_helper.cc
+++ b/chrome/browser/extensions/startup_helper.cc
@@ -264,6 +264,10 @@ void DeleteHelperAndRunCallback(AppInstallHelper* helper,
callback.Run();
}
+void DeleteHelper(AppInstallHelper* helper) {
+ delete helper;
+}
+
} // namespace
bool StartupHelper::InstallFromWebstore(const CommandLine& cmd_line,
@@ -302,6 +306,21 @@ void StartupHelper::LimitedInstallFromWebstore(
helper, done_callback));
}
+void StartupHelper::InstallChromeApp(
+ const CommandLine& cmd_line,
+ Profile* profile) {
+ std::string id = cmd_line.GetSwitchValueASCII(switches::kInstallChromeApp);
+ if (!Extension::IdIsValid(id)) {
+ LOG(ERROR) << "Invalid id for " << switches::kInstallChromeApp
+ << " : '" << id << "'";
+ return;
+ }
+
+ AppInstallHelper* helper = new AppInstallHelper();
+ helper->BeginInstall(profile, id, true /*show_prompt*/,
+ base::Bind(&DeleteHelper, helper));
+}
+
std::string StartupHelper::WebStoreIdFromLimitedInstallCmdLine(
const CommandLine& cmd_line) {
std::string index = cmd_line.GetSwitchValueASCII(

Powered by Google App Engine
This is Rietveld 408576698