Chromium Code Reviews| 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_CONTENT_WINDOW_ANDROID_H_ | |
| 6 #define CHROMECAST_BROWSER_ANDROID_CAST_CONTENT_WINDOW_ANDROID_H_ | |
| 7 | |
| 8 #include <jni.h> | |
| 9 | |
| 10 #include <memory> | |
| 11 | |
| 12 #include "base/android/scoped_java_ref.h" | |
| 13 #include "base/macros.h" | |
| 14 #include "chromecast/browser/cast_content_window.h" | |
| 15 #include "content/public/browser/web_contents_observer.h" | |
| 16 | |
| 17 namespace content { | |
| 18 class BrowserContext; | |
| 19 class WebContents; | |
| 20 } | |
| 21 | |
| 22 namespace chromecast { | |
| 23 namespace shell { | |
| 24 | |
| 25 // Android implementation of CastContentWindow, which displays WebContents in | |
| 26 // CastWebContentsActivity. | |
| 27 class CastContentWindowAndroid : public CastContentWindow, | |
| 28 public content::WebContentsObserver { | |
| 29 public: | |
| 30 static bool RegisterJni(JNIEnv* env); | |
| 31 | |
| 32 explicit CastContentWindowAndroid(CastContentWindow::Delegate* delegate); | |
|
Wez
2017/01/11 20:47:54
As noted in the Linux impl, it doesn't seem that t
derekjchow1
2017/01/11 21:54:33
Your point on constructor visibility is valid, but
Wez
2017/01/12 21:04:28
Yes, SGTM - thanks. :)
(If you would prefer to av
| |
| 33 | |
| 34 ~CastContentWindowAndroid() override; | |
| 35 | |
| 36 // CastContentWindow implementation: | |
| 37 void SetTransparent() override; | |
| 38 void ShowWebContents(content::WebContents* web_contents) override; | |
| 39 std::unique_ptr<content::WebContents> CreateWebContents( | |
| 40 content::BrowserContext* browser_context) override; | |
| 41 | |
| 42 // content::WebContentsObserver implementation: | |
| 43 void DidFirstVisuallyNonEmptyPaint() override; | |
| 44 void MediaStoppedPlaying(const MediaPlayerInfo& media_info, | |
| 45 const MediaPlayerId& id) override; | |
| 46 void MediaStartedPlaying(const MediaPlayerInfo& media_info, | |
| 47 const MediaPlayerId& id) override; | |
| 48 void RenderViewCreated(content::RenderViewHost* render_view_host) override; | |
| 49 | |
| 50 // Called through JNI. | |
| 51 void OnActivityStopped(JNIEnv* env, | |
| 52 const base::android::JavaParamRef<jobject>& jcaller); | |
| 53 void OnKeyDown(JNIEnv* env, | |
| 54 const base::android::JavaParamRef<jobject>& jcaller, | |
| 55 int keycode); | |
| 56 | |
| 57 private: | |
| 58 CastContentWindow::Delegate* const delegate_; | |
| 59 bool transparent_; | |
| 60 base::android::ScopedJavaGlobalRef<jobject> java_window_; | |
| 61 | |
| 62 DISALLOW_COPY_AND_ASSIGN(CastContentWindowAndroid); | |
| 63 }; | |
| 64 | |
| 65 } // namespace shell | |
| 66 } // namespace chromecast | |
| 67 | |
| 68 #endif // CHROMECAST_BROWSER_ANDROID_CAST_CONTENT_WINDOW_ANDROID_H_ | |
| OLD | NEW |