OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CHROMECAST_BROWSER_ANDROID_CAST_WEB_CONTENTS_ACTIVITY_H_ | 5 #ifndef CHROMECAST_BROWSER_ANDROID_CAST_WEB_CONTENTS_ACTIVITY_H_ |
6 #define CHROMECAST_BROWSER_ANDROID_CAST_WEB_CONTENTS_ACTIVITY_H_ | 6 #define CHROMECAST_BROWSER_ANDROID_CAST_WEB_CONTENTS_ACTIVITY_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/supports_user_data.h" | 12 #include "base/supports_user_data.h" |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 class WebContents; | 15 class WebContents; |
16 } | 16 } |
17 | 17 |
18 namespace chromecast { | 18 namespace chromecast { |
19 namespace shell { | 19 namespace shell { |
20 | 20 |
21 // Helper class to get members of the CastWebContentsActivity displaying a | 21 // Helper class to get members of the CastWebContentsActivity displaying a |
22 // given web_contents. This class is lazily created through the Get function and | 22 // given web_contents. This class is lazily created through the Get function and |
23 // will manage its own lifetime via SupportsUserData. | 23 // will manage its own lifetime via SupportsUserData. |
24 class CastWebContentsActivity : base::SupportsUserData::Data { | 24 class CastWebContentsActivity : public base::SupportsUserData::Data { |
25 public: | 25 public: |
| 26 ~CastWebContentsActivity() override; |
| 27 |
26 static bool RegisterJni(JNIEnv* env); | 28 static bool RegisterJni(JNIEnv* env); |
27 static CastWebContentsActivity* Get(content::WebContents* web_contents); | 29 static CastWebContentsActivity* Get(content::WebContents* web_contents); |
28 | 30 |
29 base::android::ScopedJavaLocalRef<jobject> GetContentVideoViewEmbedder(); | 31 base::android::ScopedJavaLocalRef<jobject> GetContentVideoViewEmbedder(); |
30 void SetContentVideoViewEmbedder( | 32 void SetContentVideoViewEmbedder( |
31 const base::android::JavaParamRef<jobject>& content_video_view_embedder); | 33 const base::android::JavaParamRef<jobject>& content_video_view_embedder); |
32 | 34 |
33 private: | 35 private: |
34 explicit CastWebContentsActivity(content::WebContents* web_contents); | 36 explicit CastWebContentsActivity(content::WebContents* web_contents); |
35 ~CastWebContentsActivity() override; | |
36 | 37 |
37 base::android::ScopedJavaGlobalRef<jobject> content_video_view_embedder_; | 38 base::android::ScopedJavaGlobalRef<jobject> content_video_view_embedder_; |
38 | 39 |
39 DISALLOW_COPY_AND_ASSIGN(CastWebContentsActivity); | 40 DISALLOW_COPY_AND_ASSIGN(CastWebContentsActivity); |
40 }; | 41 }; |
41 | 42 |
42 } // namespace shell | 43 } // namespace shell |
43 } // namespace chromecast | 44 } // namespace chromecast |
44 | 45 |
45 #endif // CHROMECAST_BROWSER_ANDROID_CAST_WEB_CONTENTS_ACTIVITY_H_ | 46 #endif // CHROMECAST_BROWSER_ANDROID_CAST_WEB_CONTENTS_ACTIVITY_H_ |
OLD | NEW |