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

Side by Side Diff: chrome/browser/renderer_host/render_widget_host.cc

Issue 27332: Fixing WebKeyboardEvent. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' 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 | Annotate | Revision Log
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/renderer_host/render_widget_host.h" 5 #include "chrome/browser/renderer_host/render_widget_host.h"
6 6
7 #include "base/gfx/native_widget_types.h" 7 #include "base/gfx/native_widget_types.h"
8 #include "base/histogram.h" 8 #include "base/histogram.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/keyboard_codes.h" 10 #include "base/keyboard_codes.h"
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 ForwardInputEvent(mouse_event, sizeof(WebMouseEvent)); 286 ForwardInputEvent(mouse_event, sizeof(WebMouseEvent));
287 } 287 }
288 288
289 void RenderWidgetHost::ForwardWheelEvent( 289 void RenderWidgetHost::ForwardWheelEvent(
290 const WebMouseWheelEvent& wheel_event) { 290 const WebMouseWheelEvent& wheel_event) {
291 ForwardInputEvent(wheel_event, sizeof(WebMouseWheelEvent)); 291 ForwardInputEvent(wheel_event, sizeof(WebMouseWheelEvent));
292 } 292 }
293 293
294 void RenderWidgetHost::ForwardKeyboardEvent(const WebKeyboardEvent& key_event) { 294 void RenderWidgetHost::ForwardKeyboardEvent(const WebKeyboardEvent& key_event) {
295 if (key_event.type == WebKeyboardEvent::CHAR && 295 if (key_event.type == WebKeyboardEvent::CHAR &&
296 (key_event.key_code == base::VKEY_RETURN || 296 (key_event.windows_key_code == base::VKEY_RETURN ||
297 key_event.key_code == base::VKEY_SPACE)) { 297 key_event.windows_key_code == base::VKEY_SPACE)) {
298 OnEnterOrSpace(); 298 OnEnterOrSpace();
299 } 299 }
300 300
301 ForwardInputEvent(key_event, sizeof(WebKeyboardEvent)); 301 ForwardInputEvent(key_event, sizeof(WebKeyboardEvent));
302 } 302 }
303 303
304 void RenderWidgetHost::ForwardInputEvent(const WebInputEvent& input_event, 304 void RenderWidgetHost::ForwardInputEvent(const WebInputEvent& input_event,
305 int event_size) { 305 int event_size) {
306 if (!process_->channel()) 306 if (!process_->channel())
307 return; 307 return;
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 654
655 // TODO(darin): do we need to do something else if our backing store is not 655 // TODO(darin): do we need to do something else if our backing store is not
656 // the same size as the advertised view? maybe we just assume there is a 656 // the same size as the advertised view? maybe we just assume there is a
657 // full paint on its way? 657 // full paint on its way?
658 BackingStore* backing_store = BackingStoreManager::Lookup(this); 658 BackingStore* backing_store = BackingStoreManager::Lookup(this);
659 if (!backing_store || (backing_store->size() != view_size)) 659 if (!backing_store || (backing_store->size() != view_size))
660 return; 660 return;
661 backing_store->ScrollRect(process_->process().handle(), bitmap, bitmap_rect, 661 backing_store->ScrollRect(process_->process().handle(), bitmap, bitmap_rect,
662 dx, dy, clip_rect, view_size); 662 dx, dy, clip_rect, view_size);
663 } 663 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/render_view_host.cc ('k') | chrome/browser/renderer_host/render_widget_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698