OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ |
6 #define CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ |
7 | 7 |
8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
9 #include "base/process/kill.h" | 9 #include "base/process/kill.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 #include "content/public/common/browser_plugin_permission_type.h" | 13 #include "content/public/common/browser_plugin_permission_type.h" |
14 #include "content/public/common/media_stream_request.h" | 14 #include "content/public/common/media_stream_request.h" |
15 #include "ui/gfx/geometry/rect.h" | 15 #include "ui/gfx/geometry/rect.h" |
16 #include "ui/gfx/size.h" | 16 #include "ui/gfx/size.h" |
17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 | 20 |
21 class JavaScriptDialogManager; | 21 class JavaScriptDialogManager; |
22 struct NativeWebKeyboardEvent; | 22 struct NativeWebKeyboardEvent; |
23 class WebContents; | |
23 | 24 |
24 // Objects implement this interface to get notified about changes in the guest | 25 // Objects implement this interface to get notified about changes in the guest |
25 // WebContents and to provide necessary functionality. | 26 // WebContents and to provide necessary functionality. |
26 class CONTENT_EXPORT BrowserPluginGuestDelegate { | 27 class CONTENT_EXPORT BrowserPluginGuestDelegate { |
27 public: | 28 public: |
28 virtual ~BrowserPluginGuestDelegate() {} | 29 virtual ~BrowserPluginGuestDelegate() {} |
29 | 30 |
30 // Add a message to the console. | 31 // Add a message to the console. |
31 virtual void AddMessageToConsole(int32 level, | 32 virtual void AddMessageToConsole(int32 level, |
32 const base::string16& message, | 33 const base::string16& message, |
33 int32 line_no, | 34 int32 line_no, |
34 const base::string16& source_id) {} | 35 const base::string16& source_id) {} |
35 | 36 |
36 // Request the delegate to close this guest, and do whatever cleanup it needs | 37 // Request the delegate to close this guest, and do whatever cleanup it needs |
37 // to do. | 38 // to do. |
38 virtual void Close() {} | 39 virtual void Close() {} |
39 | 40 |
40 // Notification that the embedder has completed attachment. | 41 // Notification that the embedder has completed attachment. |
41 virtual void DidAttach() {} | 42 virtual void DidAttach() {} |
42 | 43 |
44 // Returns the opener for this guest. | |
45 virtual WebContents* GetOpener() const; | |
jam
2014/05/02 19:09:06
hmm, does this need to be in content? i haven't tr
Fady Samuel
2014/05/02 21:28:20
Currently, the New Window API still resides in the
| |
46 | |
43 // Informs the delegate that the guest render process is gone. |status| | 47 // Informs the delegate that the guest render process is gone. |status| |
44 // indicates whether the guest was killed, crashed, or was terminated | 48 // indicates whether the guest was killed, crashed, or was terminated |
45 // gracefully. | 49 // gracefully. |
46 virtual void GuestProcessGone(base::TerminationStatus status) {} | 50 virtual void GuestProcessGone(base::TerminationStatus status) {} |
47 | 51 |
48 // Informs the delegate that the embedder has been destroyed. | 52 // Informs the delegate that the embedder has been destroyed. |
49 virtual void EmbedderDestroyed() {} | 53 virtual void EmbedderDestroyed() {} |
50 | 54 |
51 // Informs the delegate of a reply to the find request specified by | 55 // Informs the delegate of a reply to the find request specified by |
52 // |request_id|. | 56 // |request_id|. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
91 // |request_info|. A |callback| is provided to make the decision. | 95 // |request_info|. A |callback| is provided to make the decision. |
92 virtual void RequestPermission( | 96 virtual void RequestPermission( |
93 BrowserPluginPermissionType permission_type, | 97 BrowserPluginPermissionType permission_type, |
94 const base::DictionaryValue& request_info, | 98 const base::DictionaryValue& request_info, |
95 const PermissionResponseCallback& callback, | 99 const PermissionResponseCallback& callback, |
96 bool allowed_by_default) {} | 100 bool allowed_by_default) {} |
97 | 101 |
98 // Requests resolution of a potentially relative URL. | 102 // Requests resolution of a potentially relative URL. |
99 virtual GURL ResolveURL(const std::string& src); | 103 virtual GURL ResolveURL(const std::string& src); |
100 | 104 |
105 // Informs the delegate of the WebContents that created delegate's associated | |
106 // WebContents. | |
107 virtual void SetOpener(WebContents* opener) {} | |
108 | |
101 // Notifies that the content size of the guest has changed in autosize mode. | 109 // Notifies that the content size of the guest has changed in autosize mode. |
102 virtual void SizeChanged(const gfx::Size& old_size, | 110 virtual void SizeChanged(const gfx::Size& old_size, |
103 const gfx::Size& new_size) {} | 111 const gfx::Size& new_size) {} |
104 | 112 |
105 // Asks permission to use the camera and/or microphone. If permission is | 113 // Asks permission to use the camera and/or microphone. If permission is |
106 // granted, a call should be made to |callback| with the devices. If the | 114 // granted, a call should be made to |callback| with the devices. If the |
107 // request is denied, a call should be made to |callback| with an empty list | 115 // request is denied, a call should be made to |callback| with an empty list |
108 // of devices. |request| has the details of the request (e.g. which of audio | 116 // of devices. |request| has the details of the request (e.g. which of audio |
109 // and/or video devices are requested, and lists of available devices). | 117 // and/or video devices are requested, and lists of available devices). |
110 virtual void RequestMediaAccessPermission( | 118 virtual void RequestMediaAccessPermission( |
(...skipping 14 matching lines...) Expand all Loading... | |
125 const base::Callback<void(bool)>& callback) {} | 133 const base::Callback<void(bool)>& callback) {} |
126 | 134 |
127 // Returns a pointer to a service to manage JavaScript dialogs. May return | 135 // Returns a pointer to a service to manage JavaScript dialogs. May return |
128 // NULL in which case dialogs aren't shown. | 136 // NULL in which case dialogs aren't shown. |
129 virtual JavaScriptDialogManager* GetJavaScriptDialogManager(); | 137 virtual JavaScriptDialogManager* GetJavaScriptDialogManager(); |
130 }; | 138 }; |
131 | 139 |
132 } // namespace content | 140 } // namespace content |
133 | 141 |
134 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ | 142 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ |
OLD | NEW |