OLD | NEW |
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 "base/macros.h" | 8 #include "base/macros.h" |
9 #include "chrome/browser/media/router/media_router_dialog_controller.h" | 9 #include "chrome/browser/media/router/media_router_dialog_controller.h" |
10 #include "content/public/browser/web_contents_observer.h" | |
11 #include "content/public/browser/web_contents_user_data.h" | 10 #include "content/public/browser/web_contents_user_data.h" |
12 | 11 |
13 namespace media_router { | 12 namespace media_router { |
14 | 13 |
15 // Android implementation of the MediaRouterDialogController. | 14 // Android implementation of the MediaRouterDialogController. |
16 class MediaRouterDialogControllerAndroid | 15 class MediaRouterDialogControllerAndroid |
17 : public content::WebContentsUserData<MediaRouterDialogControllerAndroid>, | 16 : public content::WebContentsUserData<MediaRouterDialogControllerAndroid>, |
18 public MediaRouterDialogController { | 17 public MediaRouterDialogController { |
19 public: | 18 public: |
20 ~MediaRouterDialogControllerAndroid() override; | 19 ~MediaRouterDialogControllerAndroid() override; |
21 | 20 |
22 static MediaRouterDialogControllerAndroid* GetOrCreateForWebContents( | 21 static MediaRouterDialogControllerAndroid* GetOrCreateForWebContents( |
23 content::WebContents* web_contents); | 22 content::WebContents* web_contents); |
24 | 23 |
25 // MediaRouterDialogController implementation. | |
26 bool ShowMediaRouterDialogForPresentation( | |
27 scoped_ptr<CreatePresentationSessionRequest> request) override; | |
28 | |
29 private: | 24 private: |
30 friend class content::WebContentsUserData<MediaRouterDialogControllerAndroid>; | 25 friend class content::WebContentsUserData<MediaRouterDialogControllerAndroid>; |
31 | 26 |
32 // Use MediaRouterDialogControllerAndroid::CreateForWebContents() to create an | 27 // Use MediaRouterDialogControllerAndroid::CreateForWebContents() to create an |
33 // instance. | 28 // instance. |
34 explicit MediaRouterDialogControllerAndroid( | 29 explicit MediaRouterDialogControllerAndroid( |
35 content::WebContents* web_contents); | 30 content::WebContents* web_contents); |
36 | 31 |
37 base::ThreadChecker thread_checker_; | 32 // MediaRouterDialogController: |
| 33 void CreateMediaRouterDialog() override; |
| 34 void CloseMediaRouterDialog() override; |
| 35 bool IsShowingMediaRouterDialog() const override; |
38 | 36 |
39 DISALLOW_COPY_AND_ASSIGN(MediaRouterDialogControllerAndroid); | 37 DISALLOW_COPY_AND_ASSIGN(MediaRouterDialogControllerAndroid); |
40 }; | 38 }; |
41 | 39 |
42 } // namespace media_router | 40 } // namespace media_router |
43 | 41 |
44 #endif // CHROME_BROWSER_MEDIA_ANDROID_ROUTER_MEDIA_ROUTER_DIALOG_CONTROLLER_AN
DROID_H_ | 42 #endif // CHROME_BROWSER_MEDIA_ANDROID_ROUTER_MEDIA_ROUTER_DIALOG_CONTROLLER_AN
DROID_H_ |
OLD | NEW |