OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/browser_plugin/browser_plugin_guest.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "content/browser/browser_plugin/browser_plugin_embedder.h" | 10 #include "content/browser/browser_plugin/browser_plugin_embedder.h" |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 const gfx::Rect& guest_window_rect, | 460 const gfx::Rect& guest_window_rect, |
461 const gfx::Rect& guest_screen_rect, | 461 const gfx::Rect& guest_screen_rect, |
462 const WebKit::WebInputEvent& event) { | 462 const WebKit::WebInputEvent& event) { |
463 guest_window_rect_ = guest_window_rect; | 463 guest_window_rect_ = guest_window_rect; |
464 guest_screen_rect_ = guest_screen_rect; | 464 guest_screen_rect_ = guest_screen_rect; |
465 RenderViewHostImpl* guest_rvh = static_cast<RenderViewHostImpl*>( | 465 RenderViewHostImpl* guest_rvh = static_cast<RenderViewHostImpl*>( |
466 web_contents()->GetRenderViewHost()); | 466 web_contents()->GetRenderViewHost()); |
467 | 467 |
468 IPC::Message* message = NULL; | 468 IPC::Message* message = NULL; |
469 | 469 |
| 470 |
470 // TODO(fsamuel): What should we do for keyboard_shortcut field? | 471 // TODO(fsamuel): What should we do for keyboard_shortcut field? |
471 if (event.type == WebKit::WebInputEvent::KeyDown) { | 472 if (event.type == WebKit::WebInputEvent::KeyDown) { |
472 CHECK_EQ(sizeof(WebKit::WebKeyboardEvent), event.size); | 473 CHECK_EQ(sizeof(WebKit::WebKeyboardEvent), event.size); |
473 WebKit::WebKeyboardEvent key_event; | 474 WebKit::WebKeyboardEvent key_event; |
474 memcpy(&key_event, &event, event.size); | 475 memcpy(&key_event, &event, event.size); |
475 key_event.type = WebKit::WebInputEvent::RawKeyDown; | 476 key_event.type = WebKit::WebInputEvent::RawKeyDown; |
476 message = new ViewMsg_HandleInputEvent(routing_id(), &key_event, false); | 477 // TODO(jbauman): send correct input number. |
| 478 message = new ViewMsg_HandleInputEvent(routing_id(), 0, &key_event, false); |
477 } else { | 479 } else { |
478 message = new ViewMsg_HandleInputEvent(routing_id(), &event, false); | 480 message = new ViewMsg_HandleInputEvent(routing_id(), 0, &event, false); |
479 } | 481 } |
480 | 482 |
481 guest_rvh->Send(message); | 483 guest_rvh->Send(message); |
482 guest_rvh->StartHangMonitorTimeout(guest_hang_timeout_); | 484 guest_rvh->StartHangMonitorTimeout(guest_hang_timeout_); |
483 } | 485 } |
484 | 486 |
485 void BrowserPluginGuest::HandleInputEventAck(RenderViewHost* render_view_host, | 487 void BrowserPluginGuest::HandleInputEventAck(RenderViewHost* render_view_host, |
486 bool handled) { | 488 bool handled) { |
487 RenderViewHostImpl* guest_rvh = | 489 RenderViewHostImpl* guest_rvh = |
488 static_cast<RenderViewHostImpl*>(render_view_host); | 490 static_cast<RenderViewHostImpl*>(render_view_host); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 default: | 654 default: |
653 break; | 655 break; |
654 } | 656 } |
655 } | 657 } |
656 | 658 |
657 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { | 659 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { |
658 embedder_web_contents_->Send(msg); | 660 embedder_web_contents_->Send(msg); |
659 } | 661 } |
660 | 662 |
661 } // namespace content | 663 } // namespace content |
OLD | NEW |