Index: chrome/browser/extensions/webstore_startup_installer.cc |
diff --git a/chrome/browser/extensions/webstore_startup_installer.cc b/chrome/browser/extensions/webstore_startup_installer.cc |
index 9a26f8ef31bd87df8b445df738397e28eea10fbd..283dabcb3b4c6054f835ca3dc4d81fea0e5ac6a9 100644 |
--- a/chrome/browser/extensions/webstore_startup_installer.cc |
+++ b/chrome/browser/extensions/webstore_startup_installer.cc |
@@ -4,11 +4,6 @@ |
#include "chrome/browser/extensions/webstore_startup_installer.h" |
-#include "chrome/browser/profiles/profile.h" |
-#include "content/public/browser/web_contents.h" |
- |
-using content::WebContents; |
- |
namespace extensions { |
WebstoreStartupInstaller::WebstoreStartupInstaller( |
@@ -16,71 +11,21 @@ WebstoreStartupInstaller::WebstoreStartupInstaller( |
Profile* profile, |
bool show_prompt, |
const Callback& callback) |
- : WebstoreStandaloneInstaller( |
- webstore_item_id, |
- profile, |
- callback), |
- show_prompt_(show_prompt), |
- dummy_web_contents_( |
- WebContents::Create(WebContents::CreateParams(profile))) { |
+ : WebstoreInstallWithPrompt(webstore_item_id, profile, callback), |
+ show_prompt_(show_prompt) { |
+ set_install_source(WebstoreInstaller::INSTALL_SOURCE_INLINE); |
} |
WebstoreStartupInstaller::~WebstoreStartupInstaller() {} |
-bool WebstoreStartupInstaller::CheckRequestorAlive() const { |
- // Requestor is the command line, so it's always alive. |
- return true; |
-} |
- |
-const GURL& WebstoreStartupInstaller::GetRequestorURL() const { |
- return dummy_requestor_url_; |
-} |
- |
scoped_ptr<ExtensionInstallPrompt::Prompt> |
WebstoreStartupInstaller::CreateInstallPrompt() const { |
scoped_ptr<ExtensionInstallPrompt::Prompt> prompt; |
- if (show_prompt_) |
+ if (show_prompt_) { |
prompt.reset(new ExtensionInstallPrompt::Prompt( |
ExtensionInstallPrompt::INSTALL_PROMPT)); |
+ } |
return prompt.Pass(); |
} |
-scoped_ptr<ExtensionInstallPrompt> WebstoreStartupInstaller::CreateInstallUI() { |
- // The WebContents passed to ExtensionInstallPrompt is used to find a parent |
- // window for the dialog. This class uses a dummy WebContents and has no |
- // associated browser window. Pass NULL so the dialog is placed in the middle |
- // of the screen. |
- return make_scoped_ptr(new ExtensionInstallPrompt(NULL)); |
-} |
- |
-bool WebstoreStartupInstaller::ShouldShowPostInstallUI() const { |
- return false; |
-} |
- |
-bool WebstoreStartupInstaller::ShouldShowAppInstalledBubble() const { |
- return false; |
-} |
- |
-WebContents* WebstoreStartupInstaller::GetWebContents() const { |
- return dummy_web_contents_.get(); |
-} |
- |
-bool WebstoreStartupInstaller::CheckInlineInstallPermitted( |
- const base::DictionaryValue& webstore_data, |
- std::string* error) const { |
- // Requestor is the command line: ignore the property set in the store |
- // and always permit inline installs. |
- *error = ""; |
- return true; |
-} |
- |
-bool WebstoreStartupInstaller::CheckRequestorPermitted( |
- const base::DictionaryValue& webstore_data, |
- std::string* error) const { |
- // Requestor is the command line: always treat it as trusted. |
- *error = ""; |
- return true; |
-} |
- |
- |
} // namespace extensions |