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

Unified Diff: chrome/browser/media/android/router/media_router_dialog_controller_android.cc

Issue 1277883003: [PresentationAPI,Android] Implement the ChromeMediaRouterDialogController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@media-router-dialog-controller-jni
Patch Set: Corrected Cast URN domain and close the dialog fragment upon dialog dismissal. Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/MediaSource.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/android/router/media_router_dialog_controller_android.cc
diff --git a/chrome/browser/media/android/router/media_router_dialog_controller_android.cc b/chrome/browser/media/android/router/media_router_dialog_controller_android.cc
index f7efee526258bc3574ce66dbb873f6aabd650f29..93e4ce21a81e26da504fcc638a4dba4777b1cd1f 100644
--- a/chrome/browser/media/android/router/media_router_dialog_controller_android.cc
+++ b/chrome/browser/media/android/router/media_router_dialog_controller_android.cc
@@ -5,6 +5,8 @@
#include "chrome/browser/media/android/router/media_router_dialog_controller_android.h"
#include "base/android/jni_android.h"
+#include "base/android/jni_string.h"
+#include "chrome/browser/media/router/media_source.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h"
@@ -49,16 +51,30 @@ MediaRouterDialogControllerAndroid::~MediaRouterDialogControllerAndroid() {
}
void MediaRouterDialogControllerAndroid::CreateMediaRouterDialog() {
- NOTIMPLEMENTED();
+ JNIEnv* env = base::android::AttachCurrentThread();
+
+ scoped_ptr<CreatePresentationSessionRequest> presentation_request(
+ PassPresentationRequest());
+
+ ScopedJavaLocalRef<jstring> jsource_urn =
+ base::android::ConvertUTF8ToJavaString(
+ env, presentation_request->GetMediaSource().id());
+
+ Java_ChromeMediaRouterDialogController_createDialog(
+ env, java_dialog_controller_.obj(), jsource_urn.obj());
}
void MediaRouterDialogControllerAndroid::CloseMediaRouterDialog() {
- NOTIMPLEMENTED();
+ JNIEnv* env = base::android::AttachCurrentThread();
+
+ Java_ChromeMediaRouterDialogController_closeDialog(
+ env, java_dialog_controller_.obj());
}
bool MediaRouterDialogControllerAndroid::IsShowingMediaRouterDialog() const {
- NOTIMPLEMENTED();
- return false;
+ JNIEnv* env = base::android::AttachCurrentThread();
+ return Java_ChromeMediaRouterDialogController_isShowingDialog(
+ env, java_dialog_controller_.obj());
}
} // namespace media_router
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/MediaSource.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698