Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Unified Diff: ui/views/examples/webview_example.h

Issue 1255783002: [Mac] Factor out keyboard shortcut handling from ChromeEventProcessingWindow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@execute
Patch Set: UI_BASE_EXPORT CommandDispatcher Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/views/examples/webview_example.h
diff --git a/ui/views/examples/webview_example.h b/ui/views/examples/webview_example.h
index 207cb35cf6594cb233749098f0a0632da1e89c79..f04c87e8403d8c6ddab56b7273d20adca0f98dc1 100644
--- a/ui/views/examples/webview_example.h
+++ b/ui/views/examples/webview_example.h
@@ -6,6 +6,8 @@
#define UI_VIEWS_EXAMPLES_WEBVIEW_EXAMPLE_H_
#include "base/macros.h"
+#include "content/public/browser/web_contents_delegate.h"
+#include "ui/views/controls/webview/unhandled_keyboard_event_handler.h"
#include "ui/views/examples/example_base.h"
namespace content {
@@ -17,7 +19,7 @@ class WebView;
namespace examples {
-class WebViewExample : public ExampleBase {
+class WebViewExample : public ExampleBase, public content::WebContentsDelegate {
public:
explicit WebViewExample(content::BrowserContext* browser_context);
~WebViewExample() override;
@@ -25,9 +27,15 @@ class WebViewExample : public ExampleBase {
// ExampleBase:
void CreateExampleView(View* container) override;
+ // content::WebContentsDelegate:
+ void HandleKeyboardEvent(
+ content::WebContents* source,
+ const content::NativeWebKeyboardEvent& event) override;
+
private:
WebView* webview_;
content::BrowserContext* browser_context_;
+ views::UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_;
DISALLOW_COPY_AND_ASSIGN(WebViewExample);
};
« no previous file with comments | « ui/views/controls/webview/unhandled_keyboard_event_handler_mac.mm ('k') | ui/views/examples/webview_example.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698