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

Unified Diff: chrome/browser/chromeos/extensions/file_manager/private_api_misc.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: Fix test Created 6 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/file_manager/app_installer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc
diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc
index 9ef4d27c0f37d92eed2481884f5dd57b4f4d2914..5a76b20b31ce4a81ba42c8808fabf963e993aaec 100644
--- a/chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc
+++ b/chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc
@@ -47,6 +47,7 @@ namespace extensions {
namespace {
const char kCWSScope[] = "https://www.googleapis.com/auth/chromewebstore";
+const char kGoogleCastApiExtensionId[] = "mafeflapfdfljijmlienjedomfjfmhpd";
// Obtains the current app window.
apps::AppWindow* GetCurrentAppWindow(ChromeSyncExtensionFunction* function) {
@@ -269,12 +270,19 @@ bool FileBrowserPrivateInstallWebstoreItemFunction::RunAsync() {
&FileBrowserPrivateInstallWebstoreItemFunction::OnInstallComplete,
this);
+ // Only GoogleCastAPI extension can use silent installation.
+ if (params->silent_installation &&
+ params->item_id != kGoogleCastApiExtensionId) {
+ SetError("Only whiltelisted items can do silent installation.");
+ return false;
+ }
+
scoped_refptr<file_manager::AppInstaller> installer(
- new file_manager::AppInstaller(
- GetAssociatedWebContents(),
- params->item_id,
- GetProfile(),
- callback));
+ new file_manager::AppInstaller(GetAssociatedWebContents(),
+ params->item_id,
+ GetProfile(),
+ params->silent_installation,
+ callback));
// installer will be AddRef()'d in BeginInstall().
installer->BeginInstall();
return true;
« no previous file with comments | « no previous file | chrome/browser/chromeos/file_manager/app_installer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698