Chromium Code Reviews| 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.h" | |
| 8 #include "base/process/kill.h" | 9 #include "base/process/kill.h" |
| 9 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 #include "base/values.h" | |
| 10 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "content/public/common/browser_plugin/browser_plugin_message_enums.h" | |
| 11 | 14 |
| 12 namespace content { | 15 namespace content { |
| 13 | 16 |
| 14 struct NativeWebKeyboardEvent; | 17 struct NativeWebKeyboardEvent; |
| 15 | 18 |
| 16 // Objects implement this interface to get notified about changes in the guest | 19 // Objects implement this interface to get notified about changes in the guest |
| 17 // WebContents and to provide necessary functionality. | 20 // WebContents and to provide necessary functionality. |
| 18 class CONTENT_EXPORT BrowserPluginGuestDelegate { | 21 class CONTENT_EXPORT BrowserPluginGuestDelegate { |
| 19 public: | 22 public: |
| 23 typedef base::Callback<void(bool /* allow */, | |
|
lazyboy
2013/08/05 09:26:58
nit: indentation is off
Fady Samuel
2013/08/06 07:14:40
I'm not actually sure what the correct indentation
| |
| 24 const std::string& /* user_input */)> | |
| 25 PermissionResponseCallback; | |
| 26 | |
| 20 virtual ~BrowserPluginGuestDelegate() {} | 27 virtual ~BrowserPluginGuestDelegate() {} |
| 21 | 28 |
| 22 // Add a message to the console. | 29 // Add a message to the console. |
| 23 virtual void AddMessageToConsole(int32 level, | 30 virtual void AddMessageToConsole(int32 level, |
| 24 const string16& message, | 31 const string16& message, |
| 25 int32 line_no, | 32 int32 line_no, |
| 26 const string16& source_id) {} | 33 const string16& source_id) {} |
| 27 | 34 |
| 28 // Request the delegate to close this guest, and do whatever cleanup it needs | 35 // Request the delegate to close this guest, and do whatever cleanup it needs |
| 29 // to do. | 36 // to do. |
| 30 virtual void Close() {} | 37 virtual void Close() {} |
| 31 | 38 |
| 32 // Informs the delegate that the guest render process is gone. |status| | 39 // Informs the delegate that the guest render process is gone. |status| |
| 33 // indicates whether the guest was killed, crashed, or was terminated | 40 // indicates whether the guest was killed, crashed, or was terminated |
| 34 // gracefully. | 41 // gracefully. |
| 35 virtual void GuestProcessGone(base::TerminationStatus status) {} | 42 virtual void GuestProcessGone(base::TerminationStatus status) {} |
| 36 | 43 |
| 37 virtual bool HandleKeyboardEvent(const NativeWebKeyboardEvent& event); | 44 virtual bool HandleKeyboardEvent(const NativeWebKeyboardEvent& event); |
| 38 | 45 |
| 39 // Notification that the guest is no longer hung. | 46 // Notification that the guest is no longer hung. |
| 40 virtual void RendererResponsive() {} | 47 virtual void RendererResponsive() {} |
| 41 | 48 |
| 42 // Notification that the guest is hung. | 49 // Notification that the guest is hung. |
| 43 virtual void RendererUnresponsive() {} | 50 virtual void RendererUnresponsive() {} |
| 51 | |
| 52 virtual bool RequestPermission( | |
|
lazyboy
2013/08/05 09:26:58
Add comment about the method.
Fady Samuel
2013/08/06 07:14:40
Done.
| |
| 53 BrowserPluginPermissionType permission_type, | |
| 54 const base::DictionaryValue& request_info, | |
| 55 const PermissionResponseCallback& callback); | |
| 44 }; | 56 }; |
| 45 | 57 |
| 46 } // namespace content | 58 } // namespace content |
| 47 | 59 |
| 48 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ | 60 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ |
| OLD | NEW |