| Index: content/browser/browser_plugin/browser_plugin_guest.cc
|
| diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
|
| index b548139fc39466d981c9e95099e7cba50e7d796b..180f54979bbcce540e40b59909265fc488fcb516 100644
|
| --- a/content/browser/browser_plugin/browser_plugin_guest.cc
|
| +++ b/content/browser/browser_plugin/browser_plugin_guest.cc
|
| @@ -35,7 +35,6 @@
|
| #include "content/public/browser/user_metrics.h"
|
| #include "content/public/browser/web_contents_observer.h"
|
| #include "content/public/common/drop_data.h"
|
| -#include "third_party/WebKit/public/platform/WebCursorInfo.h"
|
|
|
| #if defined(OS_MACOSX)
|
| #include "content/browser/browser_plugin/browser_plugin_popup_menu_helper_mac.h"
|
| @@ -107,6 +106,24 @@ base::WeakPtr<BrowserPluginGuest> BrowserPluginGuest::AsWeakPtr() {
|
| return weak_ptr_factory_.GetWeakPtr();
|
| }
|
|
|
| +void BrowserPluginGuest::SetFocus(RenderWidgetHost* rwh, bool focused) {
|
| + focused_ = focused;
|
| + rwh->Send(new InputMsg_SetFocus(rwh->GetRoutingID(), focused));
|
| + if (!focused && mouse_locked_)
|
| + OnUnlockMouse();
|
| +
|
| + // Restore the last seen state of text input to the view.
|
| + RenderWidgetHostViewBase* rwhv = static_cast<RenderWidgetHostViewBase*>(
|
| + web_contents()->GetRenderWidgetHostView());
|
| + if (rwhv) {
|
| + ViewHostMsg_TextInputState_Params params;
|
| + params.type = last_text_input_type_;
|
| + params.mode = last_input_mode_;
|
| + params.can_compose_inline = last_can_compose_inline_;
|
| + rwhv->TextInputStateChanged(params);
|
| + }
|
| +}
|
| +
|
| bool BrowserPluginGuest::LockMouse(bool allowed) {
|
| if (!attached() || (mouse_locked_ == allowed))
|
| return false;
|
| @@ -486,7 +503,6 @@ bool BrowserPluginGuest::OnMessageReceived(const IPC::Message& message) {
|
| IPC_MESSAGE_HANDLER(ViewHostMsg_HasTouchEventHandlers,
|
| OnHasTouchEventHandlers)
|
| IPC_MESSAGE_HANDLER(ViewHostMsg_LockMouse, OnLockMouse)
|
| - IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor)
|
| IPC_MESSAGE_HANDLER(ViewHostMsg_ShowWidget, OnShowWidget)
|
| IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus)
|
| IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputStateChanged,
|
| @@ -693,21 +709,10 @@ void BrowserPluginGuest::OnResizeGuest(
|
|
|
| void BrowserPluginGuest::OnSetFocus(int browser_plugin_instance_id,
|
| bool focused) {
|
| - focused_ = focused;
|
| - Send(new InputMsg_SetFocus(routing_id(), focused));
|
| - if (!focused && mouse_locked_)
|
| - OnUnlockMouse();
|
|
|
| - // Restore the last seen state of text input to the view.
|
| - RenderWidgetHostViewBase* rwhv = static_cast<RenderWidgetHostViewBase*>(
|
| - web_contents()->GetRenderWidgetHostView());
|
| - if (rwhv) {
|
| - ViewHostMsg_TextInputState_Params params;
|
| - params.type = last_text_input_type_;
|
| - params.mode = last_input_mode_;
|
| - params.can_compose_inline = last_can_compose_inline_;
|
| - rwhv->TextInputStateChanged(params);
|
| - }
|
| + RenderWidgetHost* rwh = web_contents()->GetRenderWidgetHostView()->
|
| + GetRenderWidgetHost();
|
| + SetFocus(rwh, focused);
|
| }
|
|
|
| void BrowserPluginGuest::OnSetEditCommandsForNextKeyEvent(
|
| @@ -775,11 +780,6 @@ void BrowserPluginGuest::OnHasTouchEventHandlers(bool accept) {
|
| browser_plugin_instance_id(), accept));
|
| }
|
|
|
| -void BrowserPluginGuest::OnSetCursor(const WebCursor& cursor) {
|
| - SendMessageToEmbedder(
|
| - new BrowserPluginMsg_SetCursor(browser_plugin_instance_id(), cursor));
|
| -}
|
| -
|
| #if defined(OS_MACOSX)
|
| void BrowserPluginGuest::OnShowPopup(
|
| RenderFrameHost* render_frame_host,
|
|
|