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_WEB_VIEW_WEB_VIEW_GUEST_H_ | 5 #ifndef CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ |
6 #define CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 6 #define CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 // a particular embedder WebContents. This happens on either initial navigation | 41 // a particular embedder WebContents. This happens on either initial navigation |
42 // or through the use of the New Window API, when a new window is attached to | 42 // or through the use of the New Window API, when a new window is attached to |
43 // a particular <webview>. | 43 // a particular <webview>. |
44 class WebViewGuest : public GuestView<WebViewGuest>, | 44 class WebViewGuest : public GuestView<WebViewGuest>, |
45 public content::NotificationObserver { | 45 public content::NotificationObserver { |
46 public: | 46 public: |
47 WebViewGuest(int guest_instance_id, | 47 WebViewGuest(int guest_instance_id, |
48 content::WebContents* guest_web_contents, | 48 content::WebContents* guest_web_contents, |
49 const std::string& embedder_extension_id); | 49 const std::string& embedder_extension_id); |
50 | 50 |
| 51 // For WebViewGuest, we create special guest processes, which host the |
| 52 // tag content separately from the main application that embeds the tag. |
| 53 // A <webview> can specify both the partition name and whether the storage |
| 54 // for that partition should be persisted. Each tag gets a SiteInstance with |
| 55 // a specially formatted URL, based on the application it is hosted by and |
| 56 // the partition requested by it. The format for that URL is: |
| 57 // chrome-guest://partition_domain/persist?partition_name |
| 58 static bool GetGuestPartitionConfigForSite(const GURL& site, |
| 59 std::string* partition_domain, |
| 60 std::string* partition_name, |
| 61 bool* in_memory); |
| 62 |
51 // Returns guestview::kInstanceIDNone if |contents| does not correspond to a | 63 // Returns guestview::kInstanceIDNone if |contents| does not correspond to a |
52 // WebViewGuest. | 64 // WebViewGuest. |
53 static int GetViewInstanceId(content::WebContents* contents); | 65 static int GetViewInstanceId(content::WebContents* contents); |
54 static const char Type[]; | 66 static const char Type[]; |
55 | 67 |
56 typedef std::vector<linked_ptr<webview_api::ContextMenuItem> > MenuItemVector; | 68 typedef std::vector<linked_ptr<webview_api::ContextMenuItem> > MenuItemVector; |
57 // Shows the context menu for the guest. | 69 // Shows the context menu for the guest. |
58 // |items| acts as a filter. This restricts the current context's default | 70 // |items| acts as a filter. This restricts the current context's default |
59 // menu items to contain only the items from |items|. | 71 // menu items to contain only the items from |items|. |
60 // |items| == NULL means no filtering will be applied. | 72 // |items| == NULL means no filtering will be applied. |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 name(name) {} | 441 name(name) {} |
430 }; | 442 }; |
431 | 443 |
432 typedef std::map<WebViewGuest*, NewWindowInfo> PendingWindowMap; | 444 typedef std::map<WebViewGuest*, NewWindowInfo> PendingWindowMap; |
433 PendingWindowMap pending_new_windows_; | 445 PendingWindowMap pending_new_windows_; |
434 | 446 |
435 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); | 447 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); |
436 }; | 448 }; |
437 | 449 |
438 #endif // CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 450 #endif // CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ |
OLD | NEW |