Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/ash/cast_config_delegate_chromeos.h" | 5 #include "chrome/browser/ui/ash/cast_config_delegate_chromeos.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 "backgroundSetup.getMirrorCapableReceiversAndActivities();", | 131 "backgroundSetup.getMirrorCapableReceiversAndActivities();", |
| 132 base::Bind(&GetReceiversAndActivitiesCallback, callback)); | 132 base::Bind(&GetReceiversAndActivitiesCallback, callback)); |
| 133 } | 133 } |
| 134 | 134 |
| 135 void CastConfigDelegateChromeos::CastToReceiver( | 135 void CastConfigDelegateChromeos::CastToReceiver( |
| 136 const std::string& receiver_id) { | 136 const std::string& receiver_id) { |
| 137 ExecuteJavaScript("backgroundSetup.launchDesktopMirroring('" + receiver_id + | 137 ExecuteJavaScript("backgroundSetup.launchDesktopMirroring('" + receiver_id + |
| 138 "');"); | 138 "');"); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void CastConfigDelegateChromeos::StopCasting(const std::string& activity_id) { | 141 void CastConfigDelegateChromeos::StopCasting() { |
| 142 ExecuteJavaScript("backgroundSetup.stopCastMirroring('user-stop');"); | 142 ExecuteJavaScript("backgroundSetup.stopCastMirroring('user-stop');"); |
| 143 | |
| 144 // TODO(jdufault): Remove this after stopCasting is properly exported. The | |
|
achuithb
2015/05/19 23:57:10
Please file a bug to track this.
jdufault
2015/05/20 00:02:19
Done.
| |
| 145 // current beta/release versions of the cast extension do not export | |
| 146 // stopCastMirroring, so we will also try to call the mangled version. | |
|
achuithb
2015/05/19 23:57:10
s/mangled/minified
jdufault
2015/05/20 00:02:19
Done.
| |
| 147 ExecuteJavaScript("backgroundSetup.Qu('user-stop');"); | |
| 143 } | 148 } |
| 144 | 149 |
| 145 void CastConfigDelegateChromeos::LaunchCastOptions() { | 150 void CastConfigDelegateChromeos::LaunchCastOptions() { |
| 146 chrome::NavigateParams params( | 151 chrome::NavigateParams params( |
| 147 ProfileManager::GetActiveUserProfile(), | 152 ProfileManager::GetActiveUserProfile(), |
| 148 FindCastExtension()->GetResourceURL("options.html"), | 153 FindCastExtension()->GetResourceURL("options.html"), |
| 149 ui::PAGE_TRANSITION_LINK); | 154 ui::PAGE_TRANSITION_LINK); |
| 150 params.disposition = NEW_FOREGROUND_TAB; | 155 params.disposition = NEW_FOREGROUND_TAB; |
| 151 params.window_action = chrome::NavigateParams::SHOW_WINDOW; | 156 params.window_action = chrome::NavigateParams::SHOW_WINDOW; |
| 152 chrome::Navigate(¶ms); | 157 chrome::Navigate(¶ms); |
| 153 } | 158 } |
| 154 | 159 |
| 155 } // namespace chromeos | 160 } // namespace chromeos |
| OLD | NEW |