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

Unified Diff: chrome/browser/ui/ash/cast_config_delegate_chromeos.cc

Issue 1167643003: Correctly invoke the exported cast functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 5 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/cast_config_delegate_chromeos.cc
diff --git a/chrome/browser/ui/ash/cast_config_delegate_chromeos.cc b/chrome/browser/ui/ash/cast_config_delegate_chromeos.cc
index b2196e97705e01ef346d7214d2696d8168ced72f..2f9ccca72ad881c485d8d59b72c6c22c73172c85 100644
--- a/chrome/browser/ui/ash/cast_config_delegate_chromeos.cc
+++ b/chrome/browser/ui/ash/cast_config_delegate_chromeos.cc
@@ -127,25 +127,31 @@ bool CastConfigDelegateChromeos::HasCastExtension() const {
void CastConfigDelegateChromeos::GetReceiversAndActivities(
const ReceiversAndActivitesCallback& callback) {
+ // The methods in backgroundSetup are renamed during minification, so we have
+ // to bind the exported global API methods to backgroundSetup using call().
ExecuteJavaScriptWithCallback(
- "backgroundSetup.getMirrorCapableReceiversAndActivities();",
+ "getMirrorCapableReceiversAndActivities.call(backgroundSetup);",
base::Bind(&GetReceiversAndActivitiesCallback, callback));
}
void CastConfigDelegateChromeos::CastToReceiver(
const std::string& receiver_id) {
- ExecuteJavaScript("backgroundSetup.launchDesktopMirroring('" + receiver_id +
- "');");
+ // The methods in backgroundSetup are renamed during minification, so we have
+ // to bind the exported global API methods to backgroundSetup using call().
+ ExecuteJavaScript("launchDesktopMirroring.call(backgroundSetup, '" +
+ receiver_id + "');");
}
void CastConfigDelegateChromeos::StopCasting() {
- ExecuteJavaScript("backgroundSetup.stopMirroring('user-stop')");
+ // The methods in backgroundSetup are renamed during minification, so we have
+ // to bind the exported global API methods to backgroundSetup using call().
+ ExecuteJavaScript("stopMirroring.call(backgroundSetup, 'user-stop');");
// TODO(jdufault): Remove this after the beta/release versions of the
// cast extension have been updated so that they properly export the
// stopMirroring function. For now, we try to invoke all of the other
// names that the function goes by. See crbug.com/489929.
- ExecuteJavaScript("backgroundSetup.stopCastMirroring('user-stop');");
+ ExecuteJavaScript("stopCastMirroring.call(backgroundSetup, 'user-stop');");
ExecuteJavaScript("backgroundSetup.Qu('user-stop');");
achuithb 2015/06/08 18:51:51 Is this still necessary? Does the call() fix take
jdufault 2015/06/08 19:01:07 Thinking about it, it should be fine to eliminate
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698