Chromium Code Reviews| 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..b538c608233b54a01d97e727a72480d7c372614a 100644 |
| --- a/chrome/browser/ui/ash/cast_config_delegate_chromeos.cc |
| +++ b/chrome/browser/ui/ash/cast_config_delegate_chromeos.cc |
| @@ -127,25 +127,30 @@ 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("backgroundSetup.Qu('user-stop');"); |
|
achuithb
2015/06/08 19:09:42
Do you need this? This is a work-around for minifi
achuithb
2015/06/08 19:10:38
Or was this necessary because the symbol was not y
jdufault
2015/06/08 19:16:19
Right, the symbol was not exported yet. So we work
achuithb
2015/06/08 19:18:47
Could we file a bug so we can track this? And refe
jdufault
2015/06/08 19:29:49
Yep, see the comment above. The bug is at crbug.co
achuithb
2015/06/08 19:31:17
Ah, oops. you're right.
|
| } |