OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_RENDER_WIDGET_HOST_DELEGATE_H_ |
| 6 #define CONTENT_BROWSER_RENDER_WIDGET_HOST_DELEGATE_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "content/common/content_export.h" |
| 10 |
| 11 struct NativeWebKeyboardEvent; |
| 12 |
| 13 namespace content { |
| 14 |
| 15 // |
| 16 // RenderWidgetHostDelegate |
| 17 // |
| 18 // An interface implemented by an object interested in knowing about the state |
| 19 // of the RenderWidgetHost. |
| 20 class CONTENT_EXPORT RenderWidgetHostDelegate { |
| 21 public: |
| 22 // Callback to give the browser a chance to handle the specified keyboard |
| 23 // event before sending it to the renderer. |
| 24 // Returns true if the |event| was handled. Otherwise, if the |event| would |
| 25 // be handled in HandleKeyboardEvent() method as a normal keyboard shortcut, |
| 26 // |*is_keyboard_shortcut| should be set to true. |
| 27 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, |
| 28 bool* is_keyboard_shortcut); |
| 29 |
| 30 // Callback to inform the browser that the renderer did not process the |
| 31 // specified events. This gives an opportunity to the browser to process the |
| 32 // event (used for keyboard shortcuts). |
| 33 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {} |
| 34 |
| 35 protected: |
| 36 virtual ~RenderWidgetHostDelegate() {} |
| 37 }; |
| 38 |
| 39 } // namespace content |
| 40 |
| 41 #endif // CONTENT_BROWSER_RENDER_WIDGET_HOST_DELEGATE_H_ |
OLD | NEW |