| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BROWSER_RENDER_WIDGET_HOST_DELEGATE_H_ | 5 #ifndef CONTENT_BROWSER_RENDER_WIDGET_HOST_DELEGATE_H_ |
| 6 #define CONTENT_BROWSER_RENDER_WIDGET_HOST_DELEGATE_H_ | 6 #define CONTENT_BROWSER_RENDER_WIDGET_HOST_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
| 9 | 9 |
| 10 namespace WebKit { |
| 11 class WebMouseWheelEvent; |
| 12 } |
| 13 |
| 10 namespace content { | 14 namespace content { |
| 11 | 15 |
| 12 class RenderWidgetHostImpl; | 16 class RenderWidgetHostImpl; |
| 13 struct NativeWebKeyboardEvent; | 17 struct NativeWebKeyboardEvent; |
| 14 | 18 |
| 15 // | 19 // |
| 16 // RenderWidgetHostDelegate | 20 // RenderWidgetHostDelegate |
| 17 // | 21 // |
| 18 // An interface implemented by an object interested in knowing about the state | 22 // An interface implemented by an object interested in knowing about the state |
| 19 // of the RenderWidgetHost. | 23 // of the RenderWidgetHost. |
| 20 class CONTENT_EXPORT RenderWidgetHostDelegate { | 24 class CONTENT_EXPORT RenderWidgetHostDelegate { |
| 21 public: | 25 public: |
| 22 // The RenderWidgetHost is going to be deleted. | 26 // The RenderWidgetHost is going to be deleted. |
| 23 virtual void RenderWidgetDeleted(RenderWidgetHostImpl* render_widget_host) {} | 27 virtual void RenderWidgetDeleted(RenderWidgetHostImpl* render_widget_host) {} |
| 24 | 28 |
| 25 // Callback to give the browser a chance to handle the specified keyboard | 29 // Callback to give the browser a chance to handle the specified keyboard |
| 26 // event before sending it to the renderer. | 30 // event before sending it to the renderer. |
| 27 // Returns true if the |event| was handled. Otherwise, if the |event| would | 31 // Returns true if the |event| was handled. Otherwise, if the |event| would |
| 28 // be handled in HandleKeyboardEvent() method as a normal keyboard shortcut, | 32 // be handled in HandleKeyboardEvent() method as a normal keyboard shortcut, |
| 29 // |*is_keyboard_shortcut| should be set to true. | 33 // |*is_keyboard_shortcut| should be set to true. |
| 30 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, | 34 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, |
| 31 bool* is_keyboard_shortcut); | 35 bool* is_keyboard_shortcut); |
| 32 | 36 |
| 33 // Callback to inform the browser that the renderer did not process the | 37 // Callback to inform the browser that the renderer did not process the |
| 34 // specified events. This gives an opportunity to the browser to process the | 38 // specified events. This gives an opportunity to the browser to process the |
| 35 // event (used for keyboard shortcuts). | 39 // event (used for keyboard shortcuts). |
| 36 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {} | 40 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {} |
| 37 | 41 |
| 42 // Callback to give the browser a chance to handle the specified mouse wheel |
| 43 // event before sending it to the renderer. |
| 44 // Returns true if the |event| was handled. |
| 45 virtual bool PreHandleWheelEvent(const WebKit::WebMouseWheelEvent& event); |
| 46 |
| 38 protected: | 47 protected: |
| 39 virtual ~RenderWidgetHostDelegate() {} | 48 virtual ~RenderWidgetHostDelegate() {} |
| 40 }; | 49 }; |
| 41 | 50 |
| 42 } // namespace content | 51 } // namespace content |
| 43 | 52 |
| 44 #endif // CONTENT_BROWSER_RENDER_WIDGET_HOST_DELEGATE_H_ | 53 #endif // CONTENT_BROWSER_RENDER_WIDGET_HOST_DELEGATE_H_ |
| OLD | NEW |