OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_GUESTVIEW_GUESTVIEW_H_ | 5 #ifndef CHROME_BROWSER_GUESTVIEW_GUESTVIEW_H_ |
6 #define CHROME_BROWSER_GUESTVIEW_GUESTVIEW_H_ | 6 #define CHROME_BROWSER_GUESTVIEW_GUESTVIEW_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "content/public/browser/browser_plugin_guest_delegate.h" | 11 #include "content/public/browser/browser_plugin_guest_delegate.h" |
12 #include "content/public/browser/web_contents.h" | 12 #include "content/public/browser/web_contents.h" |
13 | 13 |
14 class AdViewGuest; | 14 class AdViewGuest; |
15 class WebViewGuest; | 15 class WebViewGuest; |
| 16 struct RendererContentSettingRules; |
16 | 17 |
17 // A GuestView is the base class browser-side API implementation for a <*view> | 18 // A GuestView is the base class browser-side API implementation for a <*view> |
18 // tag. GuestView maintains an association between a guest WebContents and an | 19 // tag. GuestView maintains an association between a guest WebContents and an |
19 // embedder WebContents. It receives events issued from the guest and relays | 20 // embedder WebContents. It receives events issued from the guest and relays |
20 // them to the embedder. | 21 // them to the embedder. |
21 class GuestView : public content::BrowserPluginGuestDelegate { | 22 class GuestView : public content::BrowserPluginGuestDelegate { |
22 public: | 23 public: |
23 enum Type { | 24 enum Type { |
24 WEBVIEW, | 25 WEBVIEW, |
25 ADVIEW, | 26 ADVIEW, |
(...skipping 29 matching lines...) Expand all Loading... |
55 // A GuestView can specify both the partition name and whether the storage | 56 // A GuestView can specify both the partition name and whether the storage |
56 // for that partition should be persisted. Each tag gets a SiteInstance with | 57 // for that partition should be persisted. Each tag gets a SiteInstance with |
57 // a specially formatted URL, based on the application it is hosted by and | 58 // a specially formatted URL, based on the application it is hosted by and |
58 // the partition requested by it. The format for that URL is: | 59 // the partition requested by it. The format for that URL is: |
59 // chrome-guest://partition_domain/persist?partition_name | 60 // chrome-guest://partition_domain/persist?partition_name |
60 static bool GetGuestPartitionConfigForSite(const GURL& site, | 61 static bool GetGuestPartitionConfigForSite(const GURL& site, |
61 std::string* partition_domain, | 62 std::string* partition_domain, |
62 std::string* partition_name, | 63 std::string* partition_name, |
63 bool* in_memory); | 64 bool* in_memory); |
64 | 65 |
| 66 // By default, JavaScript and images are enabled in guest content. |
| 67 static void GetDefaultContentSettingRules( |
| 68 RendererContentSettingRules* rules, bool incognito); |
| 69 |
65 virtual void Attach(content::WebContents* embedder_web_contents, | 70 virtual void Attach(content::WebContents* embedder_web_contents, |
66 const base::DictionaryValue& args); | 71 const base::DictionaryValue& args); |
67 | 72 |
68 content::WebContents* embedder_web_contents() const { | 73 content::WebContents* embedder_web_contents() const { |
69 return embedder_web_contents_; | 74 return embedder_web_contents_; |
70 } | 75 } |
71 | 76 |
72 // Returns the guest WebContents. | 77 // Returns the guest WebContents. |
73 content::WebContents* guest_web_contents() const { | 78 content::WebContents* guest_web_contents() const { |
74 return guest_web_contents_; | 79 return guest_web_contents_; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 int view_instance_id_; | 129 int view_instance_id_; |
125 | 130 |
126 // This is a queue of Events that are destined to be sent to the embedder once | 131 // This is a queue of Events that are destined to be sent to the embedder once |
127 // the guest is attached to a particular embedder. | 132 // the guest is attached to a particular embedder. |
128 std::queue<Event*> pending_events_; | 133 std::queue<Event*> pending_events_; |
129 | 134 |
130 DISALLOW_COPY_AND_ASSIGN(GuestView); | 135 DISALLOW_COPY_AND_ASSIGN(GuestView); |
131 }; | 136 }; |
132 | 137 |
133 #endif // CHROME_BROWSER_GUESTVIEW_GUESTVIEW_H_ | 138 #endif // CHROME_BROWSER_GUESTVIEW_GUESTVIEW_H_ |
OLD | NEW |