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

Unified Diff: ui/file_manager/video_player/js/cast/caster.js

Issue 471903002: Video Player: Disables cast feature by default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed the comment 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 | « chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/video_player/js/cast/caster.js
diff --git a/ui/file_manager/video_player/js/cast/caster.js b/ui/file_manager/video_player/js/cast/caster.js
index 7373b066d0c43f314817205bc2d20c6aaed7fefb..ad704497ef039342e30afee962964e0db9bc2b2a 100644
--- a/ui/file_manager/video_player/js/cast/caster.js
+++ b/ui/file_manager/video_player/js/cast/caster.js
@@ -10,18 +10,34 @@
// cast extension. This line prevents an exception on using localStorage.
window.__defineGetter__('localStorage', function() { return {}; });
+/**
+ * @type {string}
+ * @const
+ */
+var CAST_COMMAND_LINE_FLAG = 'enable-video-player-chromecast-support';
+
// THIS IS A TEST APP.
// TODO(yoshiki): Fix this before launch.
var APPLICATION_ID = '214CC863';
util.addPageLoadHandler(function() {
+ chrome.commandLinePrivate.hasSwitch(CAST_COMMAND_LINE_FLAG, function(result) {
+ if (result)
+ initialize();
+ }.wrap());
+}.wrap());
+
+/**
+ * Starts initialization of cast-related feature.
+ */
+function initialize() {
CastExtensionDiscoverer.findInstalledExtension(function(foundId) {
if (foundId)
loadCastAPI(initializeApi);
else
console.info('No Google Cast extension is installed.');
- });
-});
+ }.wrap());
+}
/**
* Executes the given callback after the cast extension is initialized.
« no previous file with comments | « chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698