Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_H_ | 5 #ifndef CHROMECAST_BROWSER_CAST_CONTENT_WINDOW_H_ |
| 6 #define CHROMECAST_BROWSER_CAST_CONTENT_WINDOW_H_ | 6 #define CHROMECAST_BROWSER_CAST_CONTENT_WINDOW_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "chromecast/graphics/cast_vsync_settings.h" | |
| 12 #include "content/public/browser/web_contents_observer.h" | 11 #include "content/public/browser/web_contents_observer.h" |
| 13 | 12 |
| 14 namespace aura { | |
| 15 class WindowTreeHost; | |
| 16 } | |
| 17 | |
| 18 namespace content { | 13 namespace content { |
| 19 class BrowserContext; | 14 class BrowserContext; |
| 20 class WebContents; | 15 class WebContents; |
| 21 } | 16 } |
| 22 | 17 |
| 23 namespace gfx { | |
| 24 class Size; | |
| 25 } | |
| 26 | |
| 27 namespace chromecast { | 18 namespace chromecast { |
| 28 namespace shell { | 19 namespace shell { |
| 29 | 20 |
| 30 class CastContentWindow : public content::WebContentsObserver, | 21 class CastContentWindow : public content::WebContentsObserver { |
|
derekjchow1
2016/10/24 22:43:09
Is this class used publically anymore?
| |
| 31 public CastVSyncSettings::Observer { | |
| 32 public: | 22 public: |
| 33 CastContentWindow(); | 23 CastContentWindow(); |
| 34 | 24 |
| 35 // Removes the window from the screen. | 25 // Removes the window from the screen. |
| 36 ~CastContentWindow() override; | 26 ~CastContentWindow() override; |
| 37 | 27 |
| 38 // Sets the window's background to be transparent (call before | 28 // Sets the window's background to be transparent. |
| 39 // CreateWindowTree). | |
| 40 void SetTransparent() { transparent_ = true; } | 29 void SetTransparent() { transparent_ = true; } |
| 41 | 30 |
| 42 // Create a full-screen window for |web_contents|. | |
| 43 void CreateWindowTree(content::WebContents* web_contents); | |
| 44 | |
| 45 std::unique_ptr<content::WebContents> CreateWebContents( | 31 std::unique_ptr<content::WebContents> CreateWebContents( |
| 46 content::BrowserContext* browser_context); | 32 content::BrowserContext* browser_context); |
| 47 | 33 |
| 48 // content::WebContentsObserver implementation: | 34 // content::WebContentsObserver implementation: |
| 49 void DidFirstVisuallyNonEmptyPaint() override; | 35 void DidFirstVisuallyNonEmptyPaint() override; |
| 50 void MediaStoppedPlaying(const MediaPlayerId& id) override; | 36 void MediaStoppedPlaying(const MediaPlayerId& id) override; |
| 51 void MediaStartedPlaying(const MediaPlayerId& id) override; | 37 void MediaStartedPlaying(const MediaPlayerId& id) override; |
| 52 void RenderViewCreated(content::RenderViewHost* render_view_host) override; | 38 void RenderViewCreated(content::RenderViewHost* render_view_host) override; |
| 53 | 39 |
| 54 // CastVSyncSettings::Observer implementation: | |
| 55 void OnVSyncIntervalChanged(base::TimeDelta interval) override; | |
| 56 | |
| 57 private: | 40 private: |
| 58 #if defined(USE_AURA) | |
| 59 std::unique_ptr<aura::WindowTreeHost> window_tree_host_; | |
| 60 #endif | |
| 61 bool transparent_; | 41 bool transparent_; |
| 62 | 42 |
| 63 DISALLOW_COPY_AND_ASSIGN(CastContentWindow); | 43 DISALLOW_COPY_AND_ASSIGN(CastContentWindow); |
| 64 }; | 44 }; |
| 65 | 45 |
| 66 } // namespace shell | 46 } // namespace shell |
| 67 } // namespace chromecast | 47 } // namespace chromecast |
| 68 | 48 |
| 69 #endif // CHROMECAST_BROWSER_CAST_CONTENT_WINDOW_H_ | 49 #endif // CHROMECAST_BROWSER_CAST_CONTENT_WINDOW_H_ |
| OLD | NEW |