Chromium Code Reviews| 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 content { | 10 namespace content { |
| 11 | 11 |
| 12 class RenderWidgetHostImpl; | |
| 12 struct NativeWebKeyboardEvent; | 13 struct NativeWebKeyboardEvent; |
| 13 | 14 |
| 14 // | 15 // |
| 15 // RenderWidgetHostDelegate | 16 // RenderWidgetHostDelegate |
| 16 // | 17 // |
| 17 // An interface implemented by an object interested in knowing about the state | 18 // An interface implemented by an object interested in knowing about the state |
| 18 // of the RenderWidgetHost. | 19 // of the RenderWidgetHost. |
| 19 class CONTENT_EXPORT RenderWidgetHostDelegate { | 20 class CONTENT_EXPORT RenderWidgetHostDelegate { |
| 20 public: | 21 public: |
| 22 // The RenderWidgetHostImpl is going to be deleted. | |
|
jam
2012/09/24 19:20:51
nit: "RenderWidgetHost"
yzshen1
2012/09/24 19:56:18
Done.
| |
| 23 virtual void RenderWidgetDeleted(RenderWidgetHostImpl* render_widget_host) {} | |
| 24 | |
| 21 // Callback to give the browser a chance to handle the specified keyboard | 25 // Callback to give the browser a chance to handle the specified keyboard |
| 22 // event before sending it to the renderer. | 26 // event before sending it to the renderer. |
| 23 // Returns true if the |event| was handled. Otherwise, if the |event| would | 27 // Returns true if the |event| was handled. Otherwise, if the |event| would |
| 24 // be handled in HandleKeyboardEvent() method as a normal keyboard shortcut, | 28 // be handled in HandleKeyboardEvent() method as a normal keyboard shortcut, |
| 25 // |*is_keyboard_shortcut| should be set to true. | 29 // |*is_keyboard_shortcut| should be set to true. |
| 26 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, | 30 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, |
| 27 bool* is_keyboard_shortcut); | 31 bool* is_keyboard_shortcut); |
| 28 | 32 |
| 29 // Callback to inform the browser that the renderer did not process the | 33 // Callback to inform the browser that the renderer did not process the |
| 30 // specified events. This gives an opportunity to the browser to process the | 34 // specified events. This gives an opportunity to the browser to process the |
| 31 // event (used for keyboard shortcuts). | 35 // event (used for keyboard shortcuts). |
| 32 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {} | 36 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {} |
| 33 | 37 |
| 34 protected: | 38 protected: |
| 35 virtual ~RenderWidgetHostDelegate() {} | 39 virtual ~RenderWidgetHostDelegate() {} |
| 36 }; | 40 }; |
| 37 | 41 |
| 38 } // namespace content | 42 } // namespace content |
| 39 | 43 |
| 40 #endif // CONTENT_BROWSER_RENDER_WIDGET_HOST_DELEGATE_H_ | 44 #endif // CONTENT_BROWSER_RENDER_WIDGET_HOST_DELEGATE_H_ |
| OLD | NEW |