OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROMECAST_BROWSER_ANDROID_CAST_WEB_CONTENTS_ACTIVITY_H_ |
| 6 #define CHROMECAST_BROWSER_ANDROID_CAST_WEB_CONTENTS_ACTIVITY_H_ |
| 7 |
| 8 #include <jni.h> |
| 9 |
| 10 #include "base/android/scoped_java_ref.h" |
| 11 #include "base/macros.h" |
| 12 #include "base/supports_user_data.h" |
| 13 |
| 14 namespace content { |
| 15 class WebContents; |
| 16 } |
| 17 |
| 18 namespace chromecast { |
| 19 namespace shell { |
| 20 |
| 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 |
| 23 // will manage its own lifetime via SupportsUserData. |
| 24 class CastWebContentsActivity : base::SupportsUserData::Data { |
| 25 public: |
| 26 static bool RegisterJni(JNIEnv* env); |
| 27 static CastWebContentsActivity* Get(content::WebContents* web_contents); |
| 28 |
| 29 base::android::ScopedJavaLocalRef<jobject> GetContentVideoViewEmbedder(); |
| 30 void SetContentVideoViewEmbedder( |
| 31 const base::android::JavaRef<jobject>& content_video_view_embedder); |
| 32 |
| 33 private: |
| 34 explicit CastWebContentsActivity(content::WebContents* web_contents); |
| 35 ~CastWebContentsActivity() override; |
| 36 |
| 37 base::android::ScopedJavaGlobalRef<jobject> content_video_view_embedder_; |
| 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(CastWebContentsActivity); |
| 40 }; |
| 41 |
| 42 } // namespace shell |
| 43 } // namespace chromecast |
| 44 |
| 45 #endif // CHROMECAST_BROWSER_ANDROID_CAST_WEB_CONTENTS_ACTIVITY_H_ |
OLD | NEW |