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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 // This is used to ensure pending tasks will not fire after this object is | 411 // This is used to ensure pending tasks will not fire after this object is |
410 // destroyed. | 412 // destroyed. |
411 base::WeakPtrFactory<WebViewGuest> weak_ptr_factory_; | 413 base::WeakPtrFactory<WebViewGuest> weak_ptr_factory_; |
412 | 414 |
413 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); | 415 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); |
414 }; | 416 }; |
415 | 417 |
416 } // namespace extensions | 418 } // namespace extensions |
417 | 419 |
418 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 420 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ |
OLD | NEW |