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

Side by Side Diff: chrome/browser/tab_contents/web_contents_view_win.cc

Issue 40065: RenderWidgetHost now stores both the WebKeyboardEvent and the native (Closed)
Patch Set: Redesign Created 11 years, 9 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 #include "chrome/browser/tab_contents/web_contents_view_win.h" 5 #include "chrome/browser/tab_contents/web_contents_view_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "chrome/browser/bookmarks/bookmark_drag_data.h" 9 #include "chrome/browser/bookmarks/bookmark_drag_data.h"
10 #include "chrome/browser/browser.h" // TODO(beng): this dependency is awful. 10 #include "chrome/browser/browser.h" // TODO(beng): this dependency is awful.
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 void WebContentsViewWin::TakeFocus(bool reverse) { 240 void WebContentsViewWin::TakeFocus(bool reverse) {
241 views::FocusManager* focus_manager = 241 views::FocusManager* focus_manager =
242 views::FocusManager::GetFocusManager(GetNativeView()); 242 views::FocusManager::GetFocusManager(GetNativeView());
243 243
244 // We may not have a focus manager if the tab has been switched before this 244 // We may not have a focus manager if the tab has been switched before this
245 // message arrived. 245 // message arrived.
246 if (focus_manager) 246 if (focus_manager)
247 focus_manager->AdvanceFocus(reverse); 247 focus_manager->AdvanceFocus(reverse);
248 } 248 }
249 249
250 void WebContentsViewWin::HandleKeyboardEvent(const WebKeyboardEvent& event) { 250 void WebContentsViewWin::HandleKeyboardEvent(
251 const NativeWebKeyboardEvent& event) {
251 // Previous calls to TranslateMessage can generate CHAR events as well as 252 // Previous calls to TranslateMessage can generate CHAR events as well as
252 // RAW_KEY_DOWN events, even if the latter triggered an accelerator. In these 253 // RAW_KEY_DOWN events, even if the latter triggered an accelerator. In these
253 // cases, we discard the CHAR events. 254 // cases, we discard the CHAR events.
254 if (event.type == WebInputEvent::CHAR && ignore_next_char_event_) { 255 if (event.type == WebInputEvent::CHAR && ignore_next_char_event_) {
255 ignore_next_char_event_ = false; 256 ignore_next_char_event_ = false;
256 return; 257 return;
257 } 258 }
258 ignore_next_char_event_ = false; 259 ignore_next_char_event_ = false;
259 260
260 // The renderer returned a keyboard event it did not process. This may be 261 // The renderer returned a keyboard event it did not process. This may be
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 } 624 }
624 return false; 625 return false;
625 } 626 }
626 627
627 void WebContentsViewWin::WheelZoom(int distance) { 628 void WebContentsViewWin::WheelZoom(int distance) {
628 if (web_contents_->delegate()) { 629 if (web_contents_->delegate()) {
629 bool zoom_in = distance > 0; 630 bool zoom_in = distance > 0;
630 web_contents_->delegate()->ContentsZoomChange(zoom_in); 631 web_contents_->delegate()->ContentsZoomChange(zoom_in);
631 } 632 }
632 } 633 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698