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_APP_VIEW_APP_VIEW_GUEST_H_ | 5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_APP_VIEW_APP_VIEW_GUEST_H_ |
6 #define EXTENSIONS_BROWSER_GUEST_VIEW_APP_VIEW_APP_VIEW_GUEST_H_ | 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_APP_VIEW_APP_VIEW_GUEST_H_ |
7 | 7 |
8 #include "base/id_map.h" | 8 #include "base/id_map.h" |
9 #include "components/guest_view/browser/guest_view.h" | 9 #include "components/guest_view/browser/guest_view.h" |
10 #include "extensions/browser/guest_view/app_view/app_view_guest_delegate.h" | 10 #include "extensions/browser/guest_view/app_view/app_view_guest_delegate.h" |
11 | 11 |
12 namespace extensions { | 12 namespace extensions { |
13 class Extension; | 13 class Extension; |
14 class ExtensionHost; | 14 class ExtensionHost; |
15 | 15 |
16 // An AppViewGuest provides the browser-side implementation of <appview> API. | 16 // An AppViewGuest provides the browser-side implementation of <appview> API. |
17 // AppViewGuest is created on attachment. That is, when a guest WebContents is | 17 // AppViewGuest is created on attachment. That is, when a guest WebContents is |
18 // associated with a particular embedder WebContents. This happens on calls to | 18 // associated with a particular embedder WebContents. This happens on calls to |
19 // the connect API. | 19 // the connect API. |
20 class AppViewGuest : public guest_view::GuestView<AppViewGuest> { | 20 class AppViewGuest : public guest_view::GuestView<AppViewGuest> { |
21 public: | 21 public: |
22 static const char Type[]; | 22 static const char Type[]; |
23 | 23 |
24 // Completes the creation of a WebContents associated with the provided | 24 // Completes the creation of a WebContents associated with the provided |
25 // |guest_extensions_id|. | 25 // |guest_extensions_id|. |guest_render_process_host_id| is the ID of the |
26 static bool CompletePendingRequest( | 26 // "RenderProcessHost" corresponding to the process sending this message. |
27 content::BrowserContext* browser_context, | 27 static bool CompletePendingRequest(content::BrowserContext* browser_context, |
28 const GURL& url, | 28 const GURL& url, |
29 int guest_instance_id, | 29 int guest_instance_id, |
30 const std::string& guest_extension_id); | 30 const std::string& guest_extension_id, |
| 31 int guest_render_process_host_id); |
31 | 32 |
32 static GuestViewBase* Create(content::WebContents* owner_web_contents); | 33 static GuestViewBase* Create(content::WebContents* owner_web_contents); |
33 | 34 |
| 35 static std::vector<int> GetAllRegisteredInstanceIdsForTesting(); |
| 36 |
34 // content::WebContentsDelegate implementation. | 37 // content::WebContentsDelegate implementation. |
35 bool HandleContextMenu(const content::ContextMenuParams& params) override; | 38 bool HandleContextMenu(const content::ContextMenuParams& params) override; |
36 void RequestMediaAccessPermission( | 39 void RequestMediaAccessPermission( |
37 content::WebContents* web_contents, | 40 content::WebContents* web_contents, |
38 const content::MediaStreamRequest& request, | 41 const content::MediaStreamRequest& request, |
39 const content::MediaResponseCallback& callback) override; | 42 const content::MediaResponseCallback& callback) override; |
40 bool CheckMediaAccessPermission(content::WebContents* web_contents, | 43 bool CheckMediaAccessPermission(content::WebContents* web_contents, |
41 const GURL& security_origin, | 44 const GURL& security_origin, |
42 content::MediaStreamType type) override; | 45 content::MediaStreamType type) override; |
43 | 46 |
(...skipping 29 matching lines...) Expand all Loading... |
73 // This is used to ensure pending tasks will not fire after this object is | 76 // This is used to ensure pending tasks will not fire after this object is |
74 // destroyed. | 77 // destroyed. |
75 base::WeakPtrFactory<AppViewGuest> weak_ptr_factory_; | 78 base::WeakPtrFactory<AppViewGuest> weak_ptr_factory_; |
76 | 79 |
77 DISALLOW_COPY_AND_ASSIGN(AppViewGuest); | 80 DISALLOW_COPY_AND_ASSIGN(AppViewGuest); |
78 }; | 81 }; |
79 | 82 |
80 } // namespace extensions | 83 } // namespace extensions |
81 | 84 |
82 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_APP_VIEW_APP_VIEW_GUEST_H_ | 85 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_APP_VIEW_APP_VIEW_GUEST_H_ |
OLD | NEW |