| 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_CAST_CONTENT_WINDOW_LINUX_H_ | 5 #ifndef CHROMECAST_BROWSER_CAST_CONTENT_WINDOW_LINUX_H_ |
| 6 #define CHROMECAST_BROWSER_CAST_CONTENT_WINDOW_LINUX_H_ | 6 #define CHROMECAST_BROWSER_CAST_CONTENT_WINDOW_LINUX_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "chromecast/browser/cast_content_window.h" | 11 #include "chromecast/browser/cast_content_window.h" |
| 12 #include "chromecast/graphics/cast_vsync_settings.h" | 12 #include "chromecast/graphics/cast_vsync_settings.h" |
| 13 #include "content/public/browser/web_contents_observer.h" | |
| 14 #include "ui/events/keycodes/keyboard_codes.h" | 13 #include "ui/events/keycodes/keyboard_codes.h" |
| 15 | 14 |
| 16 namespace aura { | 15 namespace aura { |
| 17 class WindowTreeHost; | 16 class WindowTreeHost; |
| 18 } | 17 } |
| 19 | 18 |
| 20 namespace content { | 19 namespace content { |
| 21 class BrowserContext; | |
| 22 class WebContents; | 20 class WebContents; |
| 23 } | 21 } |
| 24 | 22 |
| 25 namespace chromecast { | 23 namespace chromecast { |
| 26 namespace shell { | 24 namespace shell { |
| 27 | 25 |
| 28 class CastContentWindowLinux : public CastContentWindow, | 26 class CastContentWindowLinux : public CastContentWindow, |
| 29 public content::WebContentsObserver, | |
| 30 public CastVSyncSettings::Observer { | 27 public CastVSyncSettings::Observer { |
| 31 public: | 28 public: |
| 32 // Removes the window from the screen. | 29 // Removes the window from the screen. |
| 33 ~CastContentWindowLinux() override; | 30 ~CastContentWindowLinux() override; |
| 34 | 31 |
| 35 // CastContentWindow implementation. | 32 // CastContentWindow implementation. |
| 36 void SetTransparent() override; | 33 void SetTransparent() override; |
| 37 void ShowWebContents(content::WebContents* web_contents) override; | 34 void ShowWebContents(content::WebContents* web_contents) override; |
| 38 std::unique_ptr<content::WebContents> CreateWebContents( | |
| 39 content::BrowserContext* browser_context) override; | |
| 40 | |
| 41 // content::WebContentsObserver implementation: | |
| 42 void DidFirstVisuallyNonEmptyPaint() override; | |
| 43 void MediaStartedPlaying(const MediaPlayerInfo& media_info, | |
| 44 const MediaPlayerId& id) override; | |
| 45 void MediaStoppedPlaying(const MediaPlayerInfo& media_info, | |
| 46 const MediaPlayerId& id) override; | |
| 47 void RenderViewCreated(content::RenderViewHost* render_view_host) override; | |
| 48 | 35 |
| 49 // CastVSyncSettings::Observer implementation: | 36 // CastVSyncSettings::Observer implementation: |
| 50 void OnVSyncIntervalChanged(base::TimeDelta interval) override; | 37 void OnVSyncIntervalChanged(base::TimeDelta interval) override; |
| 51 | 38 |
| 52 private: | 39 private: |
| 53 friend class CastContentWindow; | 40 friend class CastContentWindow; |
| 54 | 41 |
| 55 // This class should only be instantiated by CastContentWindow::Create. | 42 // This class should only be instantiated by CastContentWindow::Create. |
| 56 CastContentWindowLinux(); | 43 CastContentWindowLinux(); |
| 57 | 44 |
| 58 #if defined(USE_AURA) | 45 #if defined(USE_AURA) |
| 59 std::unique_ptr<aura::WindowTreeHost> window_tree_host_; | 46 std::unique_ptr<aura::WindowTreeHost> window_tree_host_; |
| 60 #endif | 47 #endif |
| 61 bool transparent_; | 48 bool transparent_; |
| 62 | 49 |
| 63 DISALLOW_COPY_AND_ASSIGN(CastContentWindowLinux); | 50 DISALLOW_COPY_AND_ASSIGN(CastContentWindowLinux); |
| 64 }; | 51 }; |
| 65 | 52 |
| 66 } // namespace shell | 53 } // namespace shell |
| 67 } // namespace chromecast | 54 } // namespace chromecast |
| 68 | 55 |
| 69 #endif // CHROMECAST_BROWSER_CAST_CONTENT_WINDOW_LINUX_H_ | 56 #endif // CHROMECAST_BROWSER_CAST_CONTENT_WINDOW_LINUX_H_ |
| OLD | NEW |