| 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/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_permission_type.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: |
| 20 virtual ~BrowserPluginGuestDelegate() {} | 23 virtual ~BrowserPluginGuestDelegate() {} |
| (...skipping 13 matching lines...) Expand all Loading... |
| 34 // gracefully. | 37 // gracefully. |
| 35 virtual void GuestProcessGone(base::TerminationStatus status) {} | 38 virtual void GuestProcessGone(base::TerminationStatus status) {} |
| 36 | 39 |
| 37 virtual bool HandleKeyboardEvent(const NativeWebKeyboardEvent& event); | 40 virtual bool HandleKeyboardEvent(const NativeWebKeyboardEvent& event); |
| 38 | 41 |
| 39 // Notification that the guest is no longer hung. | 42 // Notification that the guest is no longer hung. |
| 40 virtual void RendererResponsive() {} | 43 virtual void RendererResponsive() {} |
| 41 | 44 |
| 42 // Notification that the guest is hung. | 45 // Notification that the guest is hung. |
| 43 virtual void RendererUnresponsive() {} | 46 virtual void RendererUnresponsive() {} |
| 47 |
| 48 typedef base::Callback<void(bool /* allow */, |
| 49 const std::string& /* user_input */)> |
| 50 PermissionResponseCallback; |
| 51 |
| 52 // Request permission from the delegate to perform an action of the provided |
| 53 // |permission_type|. Details of the permission request are found in |
| 54 // |request_info|. A |callback| is provided to make the decision. |
| 55 // Returns whether the delegate has, or will handle the permission request. |
| 56 virtual bool RequestPermission( |
| 57 BrowserPluginPermissionType permission_type, |
| 58 const base::DictionaryValue& request_info, |
| 59 const PermissionResponseCallback& callback); |
| 44 }; | 60 }; |
| 45 | 61 |
| 46 } // namespace content | 62 } // namespace content |
| 47 | 63 |
| 48 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ | 64 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_ |
| OLD | NEW |