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 "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "content/public/browser/web_contents.h" | 12 #include "content/public/browser/web_contents.h" |
13 #include "ui/events/event.h" | 13 #include "ui/events/event.h" |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 class BrowserContext; | |
17 class SiteInstance; | |
18 class WebContents; | 16 class WebContents; |
19 } | 17 } |
20 | 18 |
21 namespace chromecast { | 19 namespace chromecast { |
22 class CastWindowManager; | 20 class CastWindowManager; |
23 | 21 |
24 namespace shell { | 22 namespace shell { |
25 | 23 |
26 // Class that represents the "window" a WebContents is displayed in cast_shell. | 24 // Class that represents the "window" a WebContents is displayed in cast_shell. |
27 // For Linux, this represents an Aura window. For Android, this is a Activity. | 25 // For Linux, this represents an Aura window. For Android, this is a Activity. |
(...skipping 18 matching lines...) Expand all Loading... |
46 | 44 |
47 // Sets the window's background to be transparent (call before | 45 // Sets the window's background to be transparent (call before |
48 // CreateWindowTree). | 46 // CreateWindowTree). |
49 virtual void SetTransparent() = 0; | 47 virtual void SetTransparent() = 0; |
50 | 48 |
51 // Creates a full-screen window for |web_contents| and display it. | 49 // Creates a full-screen window for |web_contents| and display it. |
52 // |web_contents| should outlive this CastContentWindow. | 50 // |web_contents| should outlive this CastContentWindow. |
53 // |window_manager| should outlive this CastContentWindow. | 51 // |window_manager| should outlive this CastContentWindow. |
54 virtual void ShowWebContents(content::WebContents* web_contents, | 52 virtual void ShowWebContents(content::WebContents* web_contents, |
55 CastWindowManager* window_manager) = 0; | 53 CastWindowManager* window_manager) = 0; |
56 | |
57 // Creates a WebContents. | |
58 // TODO(derekjchow): remove this function from this class, since it doesn't | |
59 // have anything to do with displaying web_contents. | |
60 virtual std::unique_ptr<content::WebContents> CreateWebContents( | |
61 content::BrowserContext* browser_context, | |
62 scoped_refptr<content::SiteInstance> site_instance) = 0; | |
63 std::unique_ptr<content::WebContents> CreateWebContents( | |
64 content::BrowserContext* browser_context) { | |
65 return CreateWebContents(browser_context, nullptr); | |
66 } | |
67 }; | 54 }; |
68 | 55 |
69 } // namespace shell | 56 } // namespace shell |
70 } // namespace chromecast | 57 } // namespace chromecast |
71 | 58 |
72 #endif // CHROMECAST_BROWSER_CAST_CONTENT_WINDOW_H_ | 59 #endif // CHROMECAST_BROWSER_CAST_CONTENT_WINDOW_H_ |
OLD | NEW |