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 stopCastMirroring is properly exported. |
| 145 // The current beta/release versions of the cast extension do not export |
| 146 // stopCastMirroring, so we will also try to call the minified version. |
| 147 // See crbug.com/489929. |
| 148 ExecuteJavaScript("backgroundSetup.Qu('user-stop');"); |
143 } | 149 } |
144 | 150 |
145 void CastConfigDelegateChromeos::LaunchCastOptions() { | 151 void CastConfigDelegateChromeos::LaunchCastOptions() { |
146 chrome::NavigateParams params( | 152 chrome::NavigateParams params( |
147 ProfileManager::GetActiveUserProfile(), | 153 ProfileManager::GetActiveUserProfile(), |
148 FindCastExtension()->GetResourceURL("options.html"), | 154 FindCastExtension()->GetResourceURL("options.html"), |
149 ui::PAGE_TRANSITION_LINK); | 155 ui::PAGE_TRANSITION_LINK); |
150 params.disposition = NEW_FOREGROUND_TAB; | 156 params.disposition = NEW_FOREGROUND_TAB; |
151 params.window_action = chrome::NavigateParams::SHOW_WINDOW; | 157 params.window_action = chrome::NavigateParams::SHOW_WINDOW; |
152 chrome::Navigate(¶ms); | 158 chrome::Navigate(¶ms); |
153 } | 159 } |
154 | 160 |
155 } // namespace chromeos | 161 } // namespace chromeos |
OLD | NEW |