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

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

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
« no previous file with comments | « ui/views/examples/webview_example.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/examples/webview_example.cc
diff --git a/ui/views/examples/webview_example.cc b/ui/views/examples/webview_example.cc
index feae6b977f98b0bb7349932e551c37a5fbe309a1..ccde6d7e8b50b3a76d841f4b769cde61920ec13b 100644
--- a/ui/views/examples/webview_example.cc
+++ b/ui/views/examples/webview_example.cc
@@ -23,11 +23,19 @@ WebViewExample::~WebViewExample() {
void WebViewExample::CreateExampleView(View* container) {
webview_ = new WebView(browser_context_);
+ webview_->GetWebContents()->SetDelegate(this);
container->SetLayoutManager(new FillLayout);
container->AddChildView(webview_);
webview_->LoadInitialURL(GURL("http://www.google.com/"));
- webview_->web_contents()->Focus();
+ webview_->GetWebContents()->Focus();
+}
+
+void WebViewExample::HandleKeyboardEvent(
+ content::WebContents* source,
+ const content::NativeWebKeyboardEvent& event) {
+ unhandled_keyboard_event_handler_.HandleKeyboardEvent(
+ event, webview_->GetFocusManager());
}
} // namespace examples
« no previous file with comments | « ui/views/examples/webview_example.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698