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 CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ | 5 #ifndef CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ |
6 #define CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ | 6 #define CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 content::WebContents* guest_web_contents, | 51 content::WebContents* guest_web_contents, |
52 const std::string& embedder_extension_id, | 52 const std::string& embedder_extension_id, |
53 const std::string& view_type); | 53 const std::string& view_type); |
54 | 54 |
55 static GuestViewBase* FromWebContents(content::WebContents* web_contents); | 55 static GuestViewBase* FromWebContents(content::WebContents* web_contents); |
56 | 56 |
57 static GuestViewBase* From(int embedder_process_id, int instance_id); | 57 static GuestViewBase* From(int embedder_process_id, int instance_id); |
58 | 58 |
59 static bool IsGuest(content::WebContents* web_contents); | 59 static bool IsGuest(content::WebContents* web_contents); |
60 | 60 |
61 // For GuestViewBases, we create special guest processes, which host the | |
62 // tag content separately from the main application that embeds the tag. | |
63 // A GuestViewBase can specify both the partition name and whether the storage | |
64 // for that partition should be persisted. Each tag gets a SiteInstance with | |
65 // a specially formatted URL, based on the application it is hosted by and | |
66 // the partition requested by it. The format for that URL is: | |
67 // chrome-guest://partition_domain/persist?partition_name | |
68 static bool GetGuestPartitionConfigForSite(const GURL& site, | |
69 std::string* partition_domain, | |
70 std::string* partition_name, | |
71 bool* in_memory); | |
72 | |
73 // By default, JavaScript and images are enabled in guest content. | 61 // By default, JavaScript and images are enabled in guest content. |
74 static void GetDefaultContentSettingRules(RendererContentSettingRules* rules, | 62 static void GetDefaultContentSettingRules(RendererContentSettingRules* rules, |
75 bool incognito); | 63 bool incognito); |
76 | 64 |
77 virtual const char* GetViewType() const = 0; | 65 virtual const char* GetViewType() const = 0; |
78 | 66 |
79 // This method can be overriden by subclasses. This method is called when | 67 // This method can be overriden by subclasses. This method is called when |
80 // the initial set of frames within the page have completed loading. | 68 // the initial set of frames within the page have completed loading. |
81 virtual void DidStopLoading() {} | 69 virtual void DidStopLoading() {} |
82 | 70 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 scoped_ptr<EmbedderWebContentsObserver> embedder_web_contents_observer_; | 189 scoped_ptr<EmbedderWebContentsObserver> embedder_web_contents_observer_; |
202 | 190 |
203 // This is used to ensure pending tasks will not fire after this object is | 191 // This is used to ensure pending tasks will not fire after this object is |
204 // destroyed. | 192 // destroyed. |
205 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; | 193 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; |
206 | 194 |
207 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); | 195 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); |
208 }; | 196 }; |
209 | 197 |
210 #endif // CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ | 198 #endif // CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ |
OLD | NEW |