This source file includes following definitions.
- dummy_web_contents_
- CheckRequestorAlive
- GetRequestorURL
- CreateInstallPrompt
- CreateInstallUI
- ShouldShowPostInstallUI
- ShouldShowAppInstalledBubble
- GetWebContents
- CheckInlineInstallPermitted
- CheckRequestorPermitted
#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(
const std::string& webstore_item_id,
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))) {
}
WebstoreStartupInstaller::~WebstoreStartupInstaller() {}
bool WebstoreStartupInstaller::CheckRequestorAlive() const {
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_)
prompt.reset(new ExtensionInstallPrompt::Prompt(
ExtensionInstallPrompt::INSTALL_PROMPT));
return prompt.Pass();
}
scoped_ptr<ExtensionInstallPrompt> WebstoreStartupInstaller::CreateInstallUI() {
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 {
*error = "";
return true;
}
bool WebstoreStartupInstaller::CheckRequestorPermitted(
const base::DictionaryValue& webstore_data,
std::string* error) const {
*error = "";
return true;
}
}