Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Side by Side Diff: chrome/browser/guestview/guestview.h

Issue 78303005: ContentSettings API should not interact with <webview> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Jochen's comments Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698