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

Side by Side 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, 3 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 unified diff | Download patch
OLDNEW
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 UI_VIEWS_EXAMPLES_WEBVIEW_EXAMPLE_H_ 5 #ifndef UI_VIEWS_EXAMPLES_WEBVIEW_EXAMPLE_H_
6 #define UI_VIEWS_EXAMPLES_WEBVIEW_EXAMPLE_H_ 6 #define UI_VIEWS_EXAMPLES_WEBVIEW_EXAMPLE_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "content/public/browser/web_contents_delegate.h"
10 #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h"
9 #include "ui/views/examples/example_base.h" 11 #include "ui/views/examples/example_base.h"
10 12
11 namespace content { 13 namespace content {
12 class BrowserContext; 14 class BrowserContext;
13 } 15 }
14 16
15 namespace views { 17 namespace views {
16 class WebView; 18 class WebView;
17 19
18 namespace examples { 20 namespace examples {
19 21
20 class WebViewExample : public ExampleBase { 22 class WebViewExample : public ExampleBase, public content::WebContentsDelegate {
21 public: 23 public:
22 explicit WebViewExample(content::BrowserContext* browser_context); 24 explicit WebViewExample(content::BrowserContext* browser_context);
23 ~WebViewExample() override; 25 ~WebViewExample() override;
24 26
25 // ExampleBase: 27 // ExampleBase:
26 void CreateExampleView(View* container) override; 28 void CreateExampleView(View* container) override;
27 29
30 // content::WebContentsDelegate:
31 void HandleKeyboardEvent(
32 content::WebContents* source,
33 const content::NativeWebKeyboardEvent& event) override;
34
28 private: 35 private:
29 WebView* webview_; 36 WebView* webview_;
30 content::BrowserContext* browser_context_; 37 content::BrowserContext* browser_context_;
38 views::UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_;
31 39
32 DISALLOW_COPY_AND_ASSIGN(WebViewExample); 40 DISALLOW_COPY_AND_ASSIGN(WebViewExample);
33 }; 41 };
34 42
35 } // namespace examples 43 } // namespace examples
36 } // namespace views 44 } // namespace views
37 45
38 #endif // UI_VIEWS_EXAMPLES_WEBVIEW_EXAMPLE_H_ 46 #endif // UI_VIEWS_EXAMPLES_WEBVIEW_EXAMPLE_H_
OLDNEW
« 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