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