| OLD | NEW |
| 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/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/keyboard_codes.h" | 9 #include "base/keyboard_codes.h" |
| 10 #include "chrome/browser/renderer_host/backing_store.h" | 10 #include "chrome/browser/renderer_host/backing_store.h" |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 ForwardInputEvent(mouse_event, sizeof(WebMouseEvent)); | 278 ForwardInputEvent(mouse_event, sizeof(WebMouseEvent)); |
| 279 } | 279 } |
| 280 | 280 |
| 281 void RenderWidgetHost::ForwardWheelEvent( | 281 void RenderWidgetHost::ForwardWheelEvent( |
| 282 const WebMouseWheelEvent& wheel_event) { | 282 const WebMouseWheelEvent& wheel_event) { |
| 283 ForwardInputEvent(wheel_event, sizeof(WebMouseWheelEvent)); | 283 ForwardInputEvent(wheel_event, sizeof(WebMouseWheelEvent)); |
| 284 } | 284 } |
| 285 | 285 |
| 286 void RenderWidgetHost::ForwardKeyboardEvent(const WebKeyboardEvent& key_event) { | 286 void RenderWidgetHost::ForwardKeyboardEvent(const WebKeyboardEvent& key_event) { |
| 287 if (key_event.type == WebKeyboardEvent::CHAR && | 287 if (key_event.type == WebKeyboardEvent::CHAR && |
| 288 (key_event.key_code == base::VKEY_RETURN || | 288 (key_event.windows_key_code == base::VKEY_RETURN || |
| 289 key_event.key_code == base::VKEY_SPACE)) { | 289 key_event.windows_key_code == base::VKEY_SPACE)) { |
| 290 OnEnterOrSpace(); | 290 OnEnterOrSpace(); |
| 291 } | 291 } |
| 292 | 292 |
| 293 ForwardInputEvent(key_event, sizeof(WebKeyboardEvent)); | 293 ForwardInputEvent(key_event, sizeof(WebKeyboardEvent)); |
| 294 } | 294 } |
| 295 | 295 |
| 296 void RenderWidgetHost::ForwardInputEvent(const WebInputEvent& input_event, | 296 void RenderWidgetHost::ForwardInputEvent(const WebInputEvent& input_event, |
| 297 int event_size) { | 297 int event_size) { |
| 298 if (!process_->channel()) | 298 if (!process_->channel()) |
| 299 return; | 299 return; |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 | 625 |
| 626 // TODO(darin): do we need to do something else if our backing store is not | 626 // TODO(darin): do we need to do something else if our backing store is not |
| 627 // the same size as the advertised view? maybe we just assume there is a | 627 // the same size as the advertised view? maybe we just assume there is a |
| 628 // full paint on its way? | 628 // full paint on its way? |
| 629 BackingStore* backing_store = BackingStoreManager::Lookup(this); | 629 BackingStore* backing_store = BackingStoreManager::Lookup(this); |
| 630 if (!backing_store || (backing_store->size() != view_size)) | 630 if (!backing_store || (backing_store->size() != view_size)) |
| 631 return; | 631 return; |
| 632 backing_store->ScrollRect(process_->process().handle(), bitmap, bitmap_rect, | 632 backing_store->ScrollRect(process_->process().handle(), bitmap, bitmap_rect, |
| 633 dx, dy, clip_rect, view_size); | 633 dx, dy, clip_rect, view_size); |
| 634 } | 634 } |
| OLD | NEW |