| 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 ForwardInputEvent(mouse_event, sizeof(WebMouseEvent)); | 285 ForwardInputEvent(mouse_event, sizeof(WebMouseEvent)); |
| 286 } | 286 } |
| 287 | 287 |
| 288 void RenderWidgetHost::ForwardWheelEvent( | 288 void RenderWidgetHost::ForwardWheelEvent( |
| 289 const WebMouseWheelEvent& wheel_event) { | 289 const WebMouseWheelEvent& wheel_event) { |
| 290 ForwardInputEvent(wheel_event, sizeof(WebMouseWheelEvent)); | 290 ForwardInputEvent(wheel_event, sizeof(WebMouseWheelEvent)); |
| 291 } | 291 } |
| 292 | 292 |
| 293 void RenderWidgetHost::ForwardKeyboardEvent(const WebKeyboardEvent& key_event) { | 293 void RenderWidgetHost::ForwardKeyboardEvent(const WebKeyboardEvent& key_event) { |
| 294 if (key_event.type == WebKeyboardEvent::CHAR && | 294 if (key_event.type == WebKeyboardEvent::CHAR && |
| 295 (key_event.windows_key_code == base::VKEY_RETURN || | 295 (key_event.key_code == base::VKEY_RETURN || |
| 296 key_event.windows_key_code == base::VKEY_SPACE)) { | 296 key_event.key_code == base::VKEY_SPACE)) { |
| 297 OnEnterOrSpace(); | 297 OnEnterOrSpace(); |
| 298 } | 298 } |
| 299 | 299 |
| 300 ForwardInputEvent(key_event, sizeof(WebKeyboardEvent)); | 300 ForwardInputEvent(key_event, sizeof(WebKeyboardEvent)); |
| 301 } | 301 } |
| 302 | 302 |
| 303 void RenderWidgetHost::ForwardInputEvent(const WebInputEvent& input_event, | 303 void RenderWidgetHost::ForwardInputEvent(const WebInputEvent& input_event, |
| 304 int event_size) { | 304 int event_size) { |
| 305 if (!process_->channel()) | 305 if (!process_->channel()) |
| 306 return; | 306 return; |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 | 628 |
| 629 // TODO(darin): do we need to do something else if our backing store is not | 629 // TODO(darin): do we need to do something else if our backing store is not |
| 630 // the same size as the advertised view? maybe we just assume there is a | 630 // the same size as the advertised view? maybe we just assume there is a |
| 631 // full paint on its way? | 631 // full paint on its way? |
| 632 BackingStore* backing_store = BackingStoreManager::Lookup(this); | 632 BackingStore* backing_store = BackingStoreManager::Lookup(this); |
| 633 if (!backing_store || (backing_store->size() != view_size)) | 633 if (!backing_store || (backing_store->size() != view_size)) |
| 634 return; | 634 return; |
| 635 backing_store->ScrollRect(process_->process().handle(), bitmap, bitmap_rect, | 635 backing_store->ScrollRect(process_->process().handle(), bitmap, bitmap_rect, |
| 636 dx, dy, clip_rect, view_size); | 636 dx, dy, clip_rect, view_size); |
| 637 } | 637 } |
| OLD | NEW |