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
3 // found in the LICENSE file.
5 #ifndef CHROMECAST_BROWSER_CAST_CONTENT_WINDOW_H_
6 #define CHROMECAST_BROWSER_CAST_CONTENT_WINDOW_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "content/public/browser/web_contents_observer.h"
25 namespace chromecast
{
28 class CastContentWindow
: public content::WebContentsObserver
{
32 // Removes the window from the screen.
33 ~CastContentWindow() override
;
35 // Sets the window's background to be transparent (call before
37 void SetTransparent() { transparent_
= true; }
39 // Create a window with the given size for |web_contents|.
40 void CreateWindowTree(const gfx::Size
& initial_size
,
41 content::WebContents
* web_contents
);
43 scoped_ptr
<content::WebContents
> CreateWebContents(
44 const gfx::Size
& initial_size
,
45 content::BrowserContext
* browser_context
);
47 // content::WebContentsObserver implementation:
48 void DidFirstVisuallyNonEmptyPaint() override
;
49 void MediaPaused() override
;
50 void MediaStartedPlaying() override
;
51 void RenderViewCreated(content::RenderViewHost
* render_view_host
) override
;
55 scoped_ptr
<aura::WindowTreeHost
> window_tree_host_
;
59 DISALLOW_COPY_AND_ASSIGN(CastContentWindow
);
63 } // namespace chromecast
65 #endif // CHROMECAST_BROWSER_CAST_CONTENT_WINDOW_H_