OLD | NEW |
---|---|
1 // Copyright 2014 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_H_ | 5 #ifndef CHROMECAST_BROWSER_CAST_CONTENT_WINDOW_LINUX_H_ |
6 #define CHROMECAST_BROWSER_CAST_CONTENT_WINDOW_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/graphics/cast_vsync_settings.h" | 12 #include "chromecast/graphics/cast_vsync_settings.h" |
12 #include "content/public/browser/web_contents_observer.h" | 13 #include "content/public/browser/web_contents_observer.h" |
14 #include "ui/events/keycodes/keyboard_codes.h" | |
13 | 15 |
14 namespace aura { | 16 namespace aura { |
15 class WindowTreeHost; | 17 class WindowTreeHost; |
16 } | 18 } |
17 | 19 |
18 namespace content { | 20 namespace content { |
19 class BrowserContext; | 21 class BrowserContext; |
20 class WebContents; | 22 class WebContents; |
21 } | 23 } |
22 | 24 |
23 namespace chromecast { | 25 namespace chromecast { |
24 namespace shell { | 26 namespace shell { |
25 | 27 |
26 class CastContentWindow : public content::WebContentsObserver, | 28 class CastContentWindowLinux : public CastContentWindow, |
27 public CastVSyncSettings::Observer { | 29 public content::WebContentsObserver, |
30 public CastVSyncSettings::Observer { | |
Wez
2017/01/11 20:47:55
IIUC you only ever create this class via Create(),
derekjchow1
2017/01/11 21:54:34
Made constructor private, using CastContentWindow
| |
28 public: | 31 public: |
29 CastContentWindow(); | 32 CastContentWindowLinux(); |
30 | 33 |
31 // Removes the window from the screen. | 34 // Removes the window from the screen. |
32 ~CastContentWindow() override; | 35 ~CastContentWindowLinux() override; |
33 | 36 |
34 // Sets the window's background to be transparent (call before | 37 // CastContentWindow implementation. |
35 // CreateWindowTree). | 38 void SetTransparent() override; |
36 void SetTransparent() { transparent_ = true; } | 39 void ShowWebContents(content::WebContents* web_contents) override; |
37 | |
38 // Create a full-screen window for |web_contents|. | |
39 void CreateWindowTree(content::WebContents* web_contents); | |
40 | |
41 std::unique_ptr<content::WebContents> CreateWebContents( | 40 std::unique_ptr<content::WebContents> CreateWebContents( |
42 content::BrowserContext* browser_context); | 41 content::BrowserContext* browser_context) override; |
43 | 42 |
44 // content::WebContentsObserver implementation: | 43 // content::WebContentsObserver implementation: |
45 void DidFirstVisuallyNonEmptyPaint() override; | 44 void DidFirstVisuallyNonEmptyPaint() override; |
45 void MediaStoppedPlaying(const MediaPlayerInfo& media_info, | |
46 const MediaPlayerId& id) override; | |
Wez
2017/01/11 20:47:54
nit: Why did you move this? It reads more naturall
derekjchow1
2017/01/11 21:54:34
Done.
| |
46 void MediaStartedPlaying(const MediaPlayerInfo& media_info, | 47 void MediaStartedPlaying(const MediaPlayerInfo& media_info, |
47 const MediaPlayerId& id) override; | 48 const MediaPlayerId& id) override; |
48 void MediaStoppedPlaying(const MediaPlayerInfo& media_info, | |
49 const MediaPlayerId& id) override; | |
50 void RenderViewCreated(content::RenderViewHost* render_view_host) override; | 49 void RenderViewCreated(content::RenderViewHost* render_view_host) override; |
51 | 50 |
52 // CastVSyncSettings::Observer implementation: | 51 // CastVSyncSettings::Observer implementation: |
53 void OnVSyncIntervalChanged(base::TimeDelta interval) override; | 52 void OnVSyncIntervalChanged(base::TimeDelta interval) override; |
54 | 53 |
55 private: | 54 private: |
56 #if defined(USE_AURA) | 55 #if defined(USE_AURA) |
57 std::unique_ptr<aura::WindowTreeHost> window_tree_host_; | 56 std::unique_ptr<aura::WindowTreeHost> window_tree_host_; |
Wez
2017/01/11 20:47:55
Rather than have this class' impl become a no-op i
derekjchow1
2017/01/11 21:54:34
We can't quite do that. Consumers of CastContentWi
Wez
2017/01/12 21:04:28
Aha, I see! Worth mention in the bug you have fil
| |
58 #endif | 57 #endif |
59 bool transparent_; | 58 bool transparent_; |
60 | 59 |
61 DISALLOW_COPY_AND_ASSIGN(CastContentWindow); | 60 DISALLOW_COPY_AND_ASSIGN(CastContentWindowLinux); |
62 }; | 61 }; |
63 | 62 |
64 } // namespace shell | 63 } // namespace shell |
65 } // namespace chromecast | 64 } // namespace chromecast |
66 | 65 |
67 #endif // CHROMECAST_BROWSER_CAST_CONTENT_WINDOW_H_ | 66 #endif // CHROMECAST_BROWSER_CAST_CONTENT_WINDOW_LINUX_H_ |
OLD | NEW |