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

Unified Diff: chrome/browser/chromeos/file_manager/app_installer.cc

Issue 437593006: Video Player: Install the cast API extension if it is not installed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added TODO comment 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/chromeos/file_manager/app_installer.cc
diff --git a/chrome/browser/chromeos/file_manager/app_installer.cc b/chrome/browser/chromeos/file_manager/app_installer.cc
index 18ffcd52bc5f82da3d793813a7a71c8f2a0296a7..2b4773ffbd8654c90399280af0a43e33cc0caebd 100644
--- a/chrome/browser/chromeos/file_manager/app_installer.cc
+++ b/chrome/browser/chromeos/file_manager/app_installer.cc
@@ -12,6 +12,8 @@ namespace file_manager {
namespace {
const char kWebContentsDestroyedError[] = "WebContents is destroyed.";
+
+const char kGoogleCastApiExtensionId[] = "mafeflapfdfljijmlienjedomfjfmhpd";
} // namespace
class AppInstaller::WebContentsObserver : public content::WebContentsObserver {
@@ -36,11 +38,16 @@ class AppInstaller::WebContentsObserver : public content::WebContentsObserver {
AppInstaller::AppInstaller(content::WebContents* web_contents,
const std::string& item_id,
Profile* profile,
+ bool silent_installation,
const Callback& callback)
: extensions::WebstoreStandaloneInstaller(item_id, profile, callback),
+ silent_installation_(silent_installation),
callback_(callback),
web_contents_(web_contents),
web_contents_observer_(new WebContentsObserver(web_contents, this)) {
+ // Only GoogleCastAPI extension can use silent installation.
+ if (silent_installation_ && item_id != kGoogleCastApiExtensionId)
+ silent_installation_ = false;
hashimoto 2014/08/01 10:40:31 Can't we raise an error in this case?
yoshiki 2014/08/01 11:46:41 Done. This handles in the caller.
}
AppInstaller::~AppInstaller() {}
@@ -56,6 +63,9 @@ const GURL& AppInstaller::GetRequestorURL() const {
scoped_refptr<ExtensionInstallPrompt::Prompt>
AppInstaller::CreateInstallPrompt() const {
+ if (silent_installation_)
+ return NULL;
+
scoped_refptr<ExtensionInstallPrompt::Prompt> prompt(
new ExtensionInstallPrompt::Prompt(
ExtensionInstallPrompt::INLINE_INSTALL_PROMPT));

Powered by Google App Engine
This is Rietveld 408576698