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

Side by Side Diff: chrome/browser/media/android/router/media_router_dialog_controller_android.cc

Issue 2783363002: [Android,Cast] Report correctly when devices are not available. (Closed)
Patch Set: Fixed the test URLs Created 3 years, 8 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/media/android/router/media_router_dialog_controller_android.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/media/android/router/media_router_dialog_controller_and roid.h" 5 #include "chrome/browser/media/android/router/media_router_dialog_controller_and roid.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "chrome/browser/media/android/router/media_router_android.h" 9 #include "chrome/browser/media/android/router/media_router_android.h"
10 #include "chrome/browser/media/router/media_router.h" 10 #include "chrome/browser/media/router/media_router.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 80
81 CancelPresentationRequest(); 81 CancelPresentationRequest();
82 } 82 }
83 83
84 void MediaRouterDialogControllerAndroid::OnDialogCancelled( 84 void MediaRouterDialogControllerAndroid::OnDialogCancelled(
85 JNIEnv* env, 85 JNIEnv* env,
86 const JavaParamRef<jobject>& obj) { 86 const JavaParamRef<jobject>& obj) {
87 CancelPresentationRequest(); 87 CancelPresentationRequest();
88 } 88 }
89 89
90 void MediaRouterDialogControllerAndroid::OnMediaSourceNotSupported(
91 JNIEnv* env,
92 const JavaParamRef<jobject>& obj) {
93 std::unique_ptr<CreatePresentationConnectionRequest> request =
94 TakeCreateConnectionRequest();
95 if (!request)
96 return;
97
98 request->InvokeErrorCallback(content::PresentationError(
99 content::PRESENTATION_ERROR_NO_AVAILABLE_SCREENS, "No screens found."));
100 }
101
90 void MediaRouterDialogControllerAndroid::CancelPresentationRequest() { 102 void MediaRouterDialogControllerAndroid::CancelPresentationRequest() {
91 std::unique_ptr<CreatePresentationConnectionRequest> request = 103 std::unique_ptr<CreatePresentationConnectionRequest> request =
92 TakeCreateConnectionRequest(); 104 TakeCreateConnectionRequest();
93 if (!request) 105 if (!request)
94 return; 106 return;
95 107
96 request->InvokeErrorCallback(content::PresentationError( 108 request->InvokeErrorCallback(content::PresentationError(
97 content::PRESENTATION_ERROR_PRESENTATION_REQUEST_CANCELLED, 109 content::PRESENTATION_ERROR_PRESENTATION_REQUEST_CANCELLED,
98 "Dialog closed.")); 110 "Dialog closed."));
99 } 111 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 } 168 }
157 169
158 bool MediaRouterDialogControllerAndroid::IsShowingMediaRouterDialog() const { 170 bool MediaRouterDialogControllerAndroid::IsShowingMediaRouterDialog() const {
159 JNIEnv* env = base::android::AttachCurrentThread(); 171 JNIEnv* env = base::android::AttachCurrentThread();
160 return Java_ChromeMediaRouterDialogController_isShowingDialog( 172 return Java_ChromeMediaRouterDialogController_isShowingDialog(
161 env, java_dialog_controller_); 173 env, java_dialog_controller_);
162 } 174 }
163 175
164 } // namespace media_router 176 } // namespace media_router
165 177
OLDNEW
« no previous file with comments | « chrome/browser/media/android/router/media_router_dialog_controller_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698