Clear webapp storage when site data is cleared
[chromium-blink-merge.git] / chromecast / browser / cast_content_window.h
blob1fa6e1fff7f427ec946cb33bd8129dd40eeb0319
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"
12 namespace aura {
13 class WindowTreeHost;
16 namespace content {
17 class BrowserContext;
18 class WebContents;
21 namespace gfx {
22 class Size;
25 namespace chromecast {
26 namespace shell {
28 class CastContentWindow : public content::WebContentsObserver {
29 public:
30 CastContentWindow();
32 // Removes the window from the screen.
33 ~CastContentWindow() override;
35 // Sets the window's background to be transparent (call before
36 // CreateWindowTree).
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;
53 private:
54 #if defined(USE_AURA)
55 scoped_ptr<aura::WindowTreeHost> window_tree_host_;
56 #endif
57 bool transparent_;
59 DISALLOW_COPY_AND_ASSIGN(CastContentWindow);
62 } // namespace shell
63 } // namespace chromecast
65 #endif // CHROMECAST_BROWSER_CAST_CONTENT_WINDOW_H_