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| is the RenderProcessHost |
26 // for the guest contents calling this method. | |
lfg
2015/07/06 18:46:21
I know it's not part of your modifications, but co
EhsanK
2015/07/06 21:09:59
Sure. Done.
| |
26 static bool CompletePendingRequest( | 27 static bool CompletePendingRequest( |
27 content::BrowserContext* browser_context, | 28 content::BrowserContext* browser_context, |
28 const GURL& url, | 29 const GURL& url, |
29 int guest_instance_id, | 30 int guest_instance_id, |
30 const std::string& guest_extension_id); | 31 const std::string& guest_extension_id, |
32 content::RenderProcessHost* guest_render_process_host); | |
31 | 33 |
32 static GuestViewBase* Create(content::WebContents* owner_web_contents); | 34 static GuestViewBase* Create(content::WebContents* owner_web_contents); |
33 | 35 |
36 static std::vector<int> GetAllRegisteredInstanceIdsForTesting(); | |
37 | |
34 // content::WebContentsDelegate implementation. | 38 // content::WebContentsDelegate implementation. |
35 bool HandleContextMenu(const content::ContextMenuParams& params) override; | 39 bool HandleContextMenu(const content::ContextMenuParams& params) override; |
36 void RequestMediaAccessPermission( | 40 void RequestMediaAccessPermission( |
37 content::WebContents* web_contents, | 41 content::WebContents* web_contents, |
38 const content::MediaStreamRequest& request, | 42 const content::MediaStreamRequest& request, |
39 const content::MediaResponseCallback& callback) override; | 43 const content::MediaResponseCallback& callback) override; |
40 bool CheckMediaAccessPermission(content::WebContents* web_contents, | 44 bool CheckMediaAccessPermission(content::WebContents* web_contents, |
41 const GURL& security_origin, | 45 const GURL& security_origin, |
42 content::MediaStreamType type) override; | 46 content::MediaStreamType type) override; |
43 | 47 |
(...skipping 29 matching lines...) Expand all Loading... | |
73 // This is used to ensure pending tasks will not fire after this object is | 77 // This is used to ensure pending tasks will not fire after this object is |
74 // destroyed. | 78 // destroyed. |
75 base::WeakPtrFactory<AppViewGuest> weak_ptr_factory_; | 79 base::WeakPtrFactory<AppViewGuest> weak_ptr_factory_; |
76 | 80 |
77 DISALLOW_COPY_AND_ASSIGN(AppViewGuest); | 81 DISALLOW_COPY_AND_ASSIGN(AppViewGuest); |
78 }; | 82 }; |
79 | 83 |
80 } // namespace extensions | 84 } // namespace extensions |
81 | 85 |
82 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_APP_VIEW_APP_VIEW_GUEST_H_ | 86 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_APP_VIEW_APP_VIEW_GUEST_H_ |
OLD | NEW |