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)); |