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 EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ |
6 #define EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 6 #define EXTENSIONS_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 24 matching lines...) Expand all Loading... |
35 // and manages the dispatch of <webview> extension events. WebViewGuest is | 35 // and manages the dispatch of <webview> extension events. WebViewGuest is |
36 // created on attachment. That is, when a guest WebContents is associated with | 36 // created on attachment. That is, when a guest WebContents is associated with |
37 // a particular embedder WebContents. This happens on either initial navigation | 37 // a particular embedder WebContents. This happens on either initial navigation |
38 // or through the use of the New Window API, when a new window is attached to | 38 // or through the use of the New Window API, when a new window is attached to |
39 // a particular <webview>. | 39 // a particular <webview>. |
40 class WebViewGuest : public guest_view::GuestView<WebViewGuest>, | 40 class WebViewGuest : public guest_view::GuestView<WebViewGuest>, |
41 public content::NotificationObserver { | 41 public content::NotificationObserver { |
42 public: | 42 public: |
43 // Clean up state when this GuestView is being destroyed. See | 43 // Clean up state when this GuestView is being destroyed. See |
44 // GuestViewBase::CleanUp(). | 44 // GuestViewBase::CleanUp(). |
45 static void CleanUp(int embedder_process_id, int view_instance_id); | 45 static void CleanUp(content::BrowserContext* browser_context, |
| 46 int embedder_process_id, |
| 47 int view_instance_id); |
46 | 48 |
47 static GuestViewBase* Create(content::WebContents* owner_web_contents); | 49 static GuestViewBase* Create(content::WebContents* owner_web_contents); |
48 | 50 |
49 // For WebViewGuest, we create special guest processes, which host the | 51 // For WebViewGuest, we create special guest processes, which host the |
50 // tag content separately from the main application that embeds the tag. | 52 // tag content separately from the main application that embeds the tag. |
51 // A <webview> can specify both the partition name and whether the storage | 53 // A <webview> can specify both the partition name and whether the storage |
52 // for that partition should be persisted. Each tag gets a SiteInstance with | 54 // for that partition should be persisted. Each tag gets a SiteInstance with |
53 // a specially formatted URL, based on the application it is hosted by and | 55 // a specially formatted URL, based on the application it is hosted by and |
54 // the partition requested by it. The format for that URL is: | 56 // the partition requested by it. The format for that URL is: |
55 // chrome-guest://partition_domain/persist?partition_name | 57 // chrome-guest://partition_domain/persist?partition_name |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 // This is used to ensure pending tasks will not fire after this object is | 415 // This is used to ensure pending tasks will not fire after this object is |
414 // destroyed. | 416 // destroyed. |
415 base::WeakPtrFactory<WebViewGuest> weak_ptr_factory_; | 417 base::WeakPtrFactory<WebViewGuest> weak_ptr_factory_; |
416 | 418 |
417 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); | 419 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); |
418 }; | 420 }; |
419 | 421 |
420 } // namespace extensions | 422 } // namespace extensions |
421 | 423 |
422 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 424 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ |
OLD | NEW |