| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 void BrowserPluginGuest::OnShowWidget(int route_id, | 979 void BrowserPluginGuest::OnShowWidget(int route_id, |
| 980 const gfx::Rect& initial_rect) { | 980 const gfx::Rect& initial_rect) { |
| 981 GetWebContents()->ShowCreatedWidget(route_id, initial_rect); | 981 GetWebContents()->ShowCreatedWidget(route_id, initial_rect); |
| 982 } | 982 } |
| 983 | 983 |
| 984 void BrowserPluginGuest::OnTakeFocus(bool reverse) { | 984 void BrowserPluginGuest::OnTakeFocus(bool reverse) { |
| 985 SendMessageToEmbedder( | 985 SendMessageToEmbedder( |
| 986 new BrowserPluginMsg_AdvanceFocus(browser_plugin_instance_id(), reverse)); | 986 new BrowserPluginMsg_AdvanceFocus(browser_plugin_instance_id(), reverse)); |
| 987 } | 987 } |
| 988 | 988 |
| 989 void BrowserPluginGuest::OnTextInputStateChanged( | 989 void BrowserPluginGuest::OnTextInputStateChanged(const TextInputState& params) { |
| 990 const ViewHostMsg_TextInputState_Params& params) { | |
| 991 // Save the state of text input so we can restore it on focus. | 990 // Save the state of text input so we can restore it on focus. |
| 992 last_text_input_state_.reset(new ViewHostMsg_TextInputState_Params(params)); | 991 last_text_input_state_.reset(new TextInputState(params)); |
| 993 | 992 |
| 994 SendTextInputTypeChangedToView( | 993 SendTextInputTypeChangedToView( |
| 995 static_cast<RenderWidgetHostViewBase*>( | 994 static_cast<RenderWidgetHostViewBase*>( |
| 996 web_contents()->GetRenderWidgetHostView())); | 995 web_contents()->GetRenderWidgetHostView())); |
| 997 } | 996 } |
| 998 | 997 |
| 999 void BrowserPluginGuest::OnImeCancelComposition() { | 998 void BrowserPluginGuest::OnImeCancelComposition() { |
| 1000 static_cast<RenderWidgetHostViewBase*>( | 999 static_cast<RenderWidgetHostViewBase*>( |
| 1001 web_contents()->GetRenderWidgetHostView())->ImeCancelComposition(); | 1000 web_contents()->GetRenderWidgetHostView())->ImeCancelComposition(); |
| 1002 } | 1001 } |
| 1003 | 1002 |
| 1004 #if defined(OS_MACOSX) || defined(USE_AURA) | 1003 #if defined(OS_MACOSX) || defined(USE_AURA) |
| 1005 void BrowserPluginGuest::OnImeCompositionRangeChanged( | 1004 void BrowserPluginGuest::OnImeCompositionRangeChanged( |
| 1006 const gfx::Range& range, | 1005 const gfx::Range& range, |
| 1007 const std::vector<gfx::Rect>& character_bounds) { | 1006 const std::vector<gfx::Rect>& character_bounds) { |
| 1008 static_cast<RenderWidgetHostViewBase*>( | 1007 static_cast<RenderWidgetHostViewBase*>( |
| 1009 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( | 1008 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( |
| 1010 range, character_bounds); | 1009 range, character_bounds); |
| 1011 } | 1010 } |
| 1012 #endif | 1011 #endif |
| 1013 | 1012 |
| 1014 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { | 1013 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { |
| 1015 if (delegate_) | 1014 if (delegate_) |
| 1016 delegate_->SetContextMenuPosition(position); | 1015 delegate_->SetContextMenuPosition(position); |
| 1017 } | 1016 } |
| 1018 | 1017 |
| 1019 } // namespace content | 1018 } // namespace content |
| OLD | NEW |