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

Side by Side Diff: chrome/browser/ui/ash/cast_config_delegate_chromeos.cc

Issue 1145833003: Allow the cast tray to function as expected when the installed extension is missing API methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Previous patch somehow messed up the changed files Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/ash/cast_config_delegate_chromeos.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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(&params); 157 chrome::Navigate(&params);
153 } 158 }
154 159
155 } // namespace chromeos 160 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/cast_config_delegate_chromeos.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698