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

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

Issue 298303002: Add option to install an ephemeral app to ChromeOS shelf context menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added browser test Created 6 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/webstore_startup_installer.cc
diff --git a/chrome/browser/extensions/webstore_startup_installer.cc b/chrome/browser/extensions/webstore_startup_installer.cc
index 9a26f8ef31bd87df8b445df738397e28eea10fbd..b3f4024120c2cbcca9ee3a5b603847deea63d23b 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,26 +11,13 @@ 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))) {
+ : WebstoreInstallPrompt(webstore_item_id, profile, callback),
+ show_prompt_(show_prompt) {
+ set_install_source(WebstoreInstaller::INSTALL_SOURCE_INLINE);
tapted 2014/05/28 06:28:46 hm - would it be better to force child classes to
tmdiep 2014/05/28 08:39:27 WebstoreInstallPrompt is instantiated, as well as
}
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;
@@ -45,42 +27,4 @@ WebstoreStartupInstaller::CreateInstallPrompt() const {
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

Powered by Google App Engine
This is Rietveld 408576698