Refactor WebsiteSettings to operate on a SecurityInfo
[chromium-blink-merge.git] / chrome / browser / media / android / router / media_router_dialog_controller_android.h
blobbbe4a3f74985942a880cc2dbb188c5963cb604bc
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_MEDIA_ANDROID_ROUTER_MEDIA_ROUTER_DIALOG_CONTROLLER_ANDROID_H_
6 #define CHROME_BROWSER_MEDIA_ANDROID_ROUTER_MEDIA_ROUTER_DIALOG_CONTROLLER_ANDROID_H_
8 #include <jni.h>
10 #include "base/android/scoped_java_ref.h"
11 #include "base/macros.h"
12 #include "chrome/browser/media/router/media_router_dialog_controller.h"
13 #include "content/public/browser/web_contents_user_data.h"
15 namespace media_router {
17 // Android implementation of the MediaRouterDialogController.
18 class MediaRouterDialogControllerAndroid
19 : public content::WebContentsUserData<MediaRouterDialogControllerAndroid>,
20 public MediaRouterDialogController {
21 public:
22 ~MediaRouterDialogControllerAndroid() override;
24 static bool Register(JNIEnv* env);
26 static MediaRouterDialogControllerAndroid* GetOrCreateForWebContents(
27 content::WebContents* web_contents);
29 // The methods called by the Java counterpart.
31 // Notifies the controller that user has selected a sink with |jsink_id|.
32 void OnSinkSelected(JNIEnv* env, jobject obj, jstring jsink_id);
33 // Notifies the controller that the dialog has been dismissed and no device
34 // has been picked.
35 void OnDialogDismissed(JNIEnv* env, jobject obj);
37 private:
38 friend class content::WebContentsUserData<MediaRouterDialogControllerAndroid>;
40 // Use MediaRouterDialogControllerAndroid::CreateForWebContents() to create an
41 // instance.
42 explicit MediaRouterDialogControllerAndroid(
43 content::WebContents* web_contents);
45 // MediaRouterDialogController:
46 void CreateMediaRouterDialog() override;
47 void CloseMediaRouterDialog() override;
48 bool IsShowingMediaRouterDialog() const override;
50 base::android::ScopedJavaGlobalRef<jobject> java_dialog_controller_;
52 DISALLOW_COPY_AND_ASSIGN(MediaRouterDialogControllerAndroid);
55 } // namespace media_router
57 #endif // CHROME_BROWSER_MEDIA_ANDROID_ROUTER_MEDIA_ROUTER_DIALOG_CONTROLLER_ANDROID_H_