Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Side by Side Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 1652483002: Browser Side Text Input State Tracking for OOPIF. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small Fixes. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 971 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 void BrowserPluginGuest::OnShowWidget(int route_id, 982 void BrowserPluginGuest::OnShowWidget(int route_id,
983 const gfx::Rect& initial_rect) { 983 const gfx::Rect& initial_rect) {
984 GetWebContents()->ShowCreatedWidget(route_id, initial_rect); 984 GetWebContents()->ShowCreatedWidget(route_id, initial_rect);
985 } 985 }
986 986
987 void BrowserPluginGuest::OnTakeFocus(bool reverse) { 987 void BrowserPluginGuest::OnTakeFocus(bool reverse) {
988 SendMessageToEmbedder( 988 SendMessageToEmbedder(
989 new BrowserPluginMsg_AdvanceFocus(browser_plugin_instance_id(), reverse)); 989 new BrowserPluginMsg_AdvanceFocus(browser_plugin_instance_id(), reverse));
990 } 990 }
991 991
992 void BrowserPluginGuest::OnTextInputStateChanged( 992 void BrowserPluginGuest::OnTextInputStateChanged(const TextInputState& params) {
993 const ViewHostMsg_TextInputState_Params& params) {
994 // Save the state of text input so we can restore it on focus. 993 // Save the state of text input so we can restore it on focus.
995 last_text_input_state_.reset(new ViewHostMsg_TextInputState_Params(params)); 994 last_text_input_state_.reset(new TextInputState(params));
996 995
997 SendTextInputTypeChangedToView( 996 SendTextInputTypeChangedToView(
998 static_cast<RenderWidgetHostViewBase*>( 997 static_cast<RenderWidgetHostViewBase*>(
999 web_contents()->GetRenderWidgetHostView())); 998 web_contents()->GetRenderWidgetHostView()));
1000 } 999 }
1001 1000
1002 void BrowserPluginGuest::OnImeCancelComposition() { 1001 void BrowserPluginGuest::OnImeCancelComposition() {
1003 static_cast<RenderWidgetHostViewBase*>( 1002 static_cast<RenderWidgetHostViewBase*>(
1004 web_contents()->GetRenderWidgetHostView())->ImeCancelComposition(); 1003 web_contents()->GetRenderWidgetHostView())->ImeCancelComposition();
1005 } 1004 }
1006 1005
1007 #if defined(OS_MACOSX) || defined(USE_AURA) 1006 #if defined(OS_MACOSX) || defined(USE_AURA)
1008 void BrowserPluginGuest::OnImeCompositionRangeChanged( 1007 void BrowserPluginGuest::OnImeCompositionRangeChanged(
1009 const gfx::Range& range, 1008 const gfx::Range& range,
1010 const std::vector<gfx::Rect>& character_bounds) { 1009 const std::vector<gfx::Rect>& character_bounds) {
1011 static_cast<RenderWidgetHostViewBase*>( 1010 static_cast<RenderWidgetHostViewBase*>(
1012 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( 1011 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged(
1013 range, character_bounds); 1012 range, character_bounds);
1014 } 1013 }
1015 #endif 1014 #endif
1016 1015
1017 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { 1016 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) {
1018 if (delegate_) 1017 if (delegate_)
1019 delegate_->SetContextMenuPosition(position); 1018 delegate_->SetContextMenuPosition(position);
1020 } 1019 }
1021 1020
1022 } // namespace content 1021 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698