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

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

Issue 10907104: Support an --install-from-webstore command line switch (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: rebased Created 8 years, 3 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/tab_helper.cc
diff --git a/chrome/browser/extensions/tab_helper.cc b/chrome/browser/extensions/tab_helper.cc
index 0f5c91fae8b6890f85098b4a5e70e70c3d9c73f4..0d3c477111082dfcc0ddabdde2bfcdab1acdf054 100644
--- a/chrome/browser/extensions/tab_helper.cc
+++ b/chrome/browser/extensions/tab_helper.cc
@@ -259,13 +259,15 @@ void TabHelper::OnInlineWebstoreInstall(
int return_route_id,
const std::string& webstore_item_id,
const GURL& requestor_url) {
+ WebstoreInlineInstaller::Callback callback =
+ base::Bind(&TabHelper::OnInlineInstallComplete, base::Unretained(this),
+ install_id, return_route_id);
scoped_refptr<WebstoreInlineInstaller> installer(new WebstoreInlineInstaller(
web_contents(),
- install_id,
- return_route_id,
webstore_item_id,
+ WebstoreInlineInstaller::REQUIRE_VERIFIED_SITE,
requestor_url,
- this));
+ callback));
installer->BeginInstall();
}
@@ -415,16 +417,17 @@ WindowController* TabHelper::GetExtensionWindowController() const {
return ExtensionTabUtil::GetWindowControllerOfTab(web_contents());
}
-void TabHelper::OnInlineInstallSuccess(int install_id, int return_route_id) {
- Send(new ExtensionMsg_InlineWebstoreInstallResponse(
- return_route_id, install_id, true, ""));
-}
-
-void TabHelper::OnInlineInstallFailure(int install_id,
- int return_route_id,
- const std::string& error) {
- Send(new ExtensionMsg_InlineWebstoreInstallResponse(
- return_route_id, install_id, false, error));
+void TabHelper::OnInlineInstallComplete(int install_id,
+ int return_route_id,
+ bool success,
+ const std::string& error) {
+ if (success) {
+ Send(new ExtensionMsg_InlineWebstoreInstallResponse(
+ return_route_id, install_id, true, ""));
+ } else {
+ Send(new ExtensionMsg_InlineWebstoreInstallResponse(
+ return_route_id, install_id, false, error));
+ }
}
WebContents* TabHelper::GetAssociatedWebContents() const {
« no previous file with comments | « chrome/browser/extensions/tab_helper.h ('k') | chrome/browser/extensions/webstore_inline_install_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698