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

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

Issue 1270353003: [PresentationAPI, Android] Add ChromeMediaRouterDialogController.java and bind it with the native M… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@media-router-jni
Patch Set: Disabled unnecessary DCHECK 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 unified diff | Download patch
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 #ifndef CHROME_BROWSER_MEDIA_ANDROID_ROUTER_MEDIA_ROUTER_DIALOG_CONTROLLER_ANDRO ID_H_ 5 #ifndef CHROME_BROWSER_MEDIA_ANDROID_ROUTER_MEDIA_ROUTER_DIALOG_CONTROLLER_ANDRO ID_H_
6 #define CHROME_BROWSER_MEDIA_ANDROID_ROUTER_MEDIA_ROUTER_DIALOG_CONTROLLER_ANDRO ID_H_ 6 #define CHROME_BROWSER_MEDIA_ANDROID_ROUTER_MEDIA_ROUTER_DIALOG_CONTROLLER_ANDRO ID_H_
7 7
8 #include <jni.h>
9
10 #include "base/android/scoped_java_ref.h"
8 #include "base/macros.h" 11 #include "base/macros.h"
9 #include "chrome/browser/media/router/media_router_dialog_controller.h" 12 #include "chrome/browser/media/router/media_router_dialog_controller.h"
10 #include "content/public/browser/web_contents_user_data.h" 13 #include "content/public/browser/web_contents_user_data.h"
11 14
12 namespace media_router { 15 namespace media_router {
13 16
14 // Android implementation of the MediaRouterDialogController. 17 // Android implementation of the MediaRouterDialogController.
15 class MediaRouterDialogControllerAndroid 18 class MediaRouterDialogControllerAndroid
16 : public content::WebContentsUserData<MediaRouterDialogControllerAndroid>, 19 : public content::WebContentsUserData<MediaRouterDialogControllerAndroid>,
17 public MediaRouterDialogController { 20 public MediaRouterDialogController {
18 public: 21 public:
19 ~MediaRouterDialogControllerAndroid() override; 22 ~MediaRouterDialogControllerAndroid() override;
20 23
24 static bool Register(JNIEnv* env);
25
21 static MediaRouterDialogControllerAndroid* GetOrCreateForWebContents( 26 static MediaRouterDialogControllerAndroid* GetOrCreateForWebContents(
22 content::WebContents* web_contents); 27 content::WebContents* web_contents);
23 28
24 private: 29 private:
25 friend class content::WebContentsUserData<MediaRouterDialogControllerAndroid>; 30 friend class content::WebContentsUserData<MediaRouterDialogControllerAndroid>;
26 31
27 // Use MediaRouterDialogControllerAndroid::CreateForWebContents() to create an 32 // Use MediaRouterDialogControllerAndroid::CreateForWebContents() to create an
28 // instance. 33 // instance.
29 explicit MediaRouterDialogControllerAndroid( 34 explicit MediaRouterDialogControllerAndroid(
30 content::WebContents* web_contents); 35 content::WebContents* web_contents);
31 36
32 // MediaRouterDialogController: 37 // MediaRouterDialogController:
33 void CreateMediaRouterDialog() override; 38 void CreateMediaRouterDialog() override;
34 void CloseMediaRouterDialog() override; 39 void CloseMediaRouterDialog() override;
35 bool IsShowingMediaRouterDialog() const override; 40 bool IsShowingMediaRouterDialog() const override;
36 41
42 base::android::ScopedJavaGlobalRef<jobject> java_dialog_controller_;
43
37 DISALLOW_COPY_AND_ASSIGN(MediaRouterDialogControllerAndroid); 44 DISALLOW_COPY_AND_ASSIGN(MediaRouterDialogControllerAndroid);
38 }; 45 };
39 46
40 } // namespace media_router 47 } // namespace media_router
41 48
42 #endif // CHROME_BROWSER_MEDIA_ANDROID_ROUTER_MEDIA_ROUTER_DIALOG_CONTROLLER_AN DROID_H_ 49 #endif // CHROME_BROWSER_MEDIA_ANDROID_ROUTER_MEDIA_ROUTER_DIALOG_CONTROLLER_AN DROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698