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

Side by Side Diff: content/renderer/render_widget.cc

Issue 2741993003: Revert restartInput change off the M57 release branch. (Closed)
Patch Set: Rebase Created 3 years, 9 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/renderer/render_widget.h" 5 #include "content/renderer/render_widget.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after
1023 // Nothing to do here. RenderWidget created the |input_handler| and will take 1023 // Nothing to do here. RenderWidget created the |input_handler| and will take
1024 // ownership of it. We just verify here that we don't already have an input 1024 // ownership of it. We just verify here that we don't already have an input
1025 // handler. 1025 // handler.
1026 DCHECK(!input_handler_); 1026 DCHECK(!input_handler_);
1027 } 1027 }
1028 1028
1029 void RenderWidget::ShowVirtualKeyboard() { 1029 void RenderWidget::ShowVirtualKeyboard() {
1030 UpdateTextInputStateInternal(true, false); 1030 UpdateTextInputStateInternal(true, false);
1031 } 1031 }
1032 1032
1033 void RenderWidget::ClearTextInputState() {
1034 text_input_info_ = blink::WebTextInputInfo();
1035 text_input_type_ = ui::TextInputType::TEXT_INPUT_TYPE_NONE;
1036 text_input_mode_ = ui::TextInputMode::TEXT_INPUT_MODE_DEFAULT;
1037 can_compose_inline_ = false;
1038 text_input_flags_ = 0;
1039 }
1040
1041 void RenderWidget::UpdateTextInputState() { 1033 void RenderWidget::UpdateTextInputState() {
1042 UpdateTextInputStateInternal(false, false); 1034 UpdateTextInputStateInternal(false, false);
1043 } 1035 }
1044 1036
1045 void RenderWidget::UpdateTextInputStateInternal(bool show_virtual_keyboard, 1037 void RenderWidget::UpdateTextInputStateInternal(bool show_virtual_keyboard,
1046 bool reply_to_request) { 1038 bool reply_to_request) {
1047 TRACE_EVENT0("renderer", "RenderWidget::UpdateTextInputState"); 1039 TRACE_EVENT0("renderer", "RenderWidget::UpdateTextInputState");
1048 1040
1049 if (ime_event_guard_) { 1041 if (ime_event_guard_) {
1050 DCHECK(!reply_to_request); 1042 DCHECK(!reply_to_request);
(...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after
2092 break; 2084 break;
2093 default: 2085 default:
2094 web_screen_info.orientationType = 2086 web_screen_info.orientationType =
2095 blink::WebScreenOrientationUndefined; 2087 blink::WebScreenOrientationUndefined;
2096 break; 2088 break;
2097 } 2089 }
2098 web_screen_info.orientationAngle = screen_info_.orientation_angle; 2090 web_screen_info.orientationAngle = screen_info_.orientation_angle;
2099 return web_screen_info; 2091 return web_screen_info;
2100 } 2092 }
2101 2093
2094 void RenderWidget::resetInputMethod() {
2095 ImeEventGuard guard(this);
2096 Send(new InputHostMsg_ImeCancelComposition(routing_id()));
2097
2098 UpdateCompositionInfo(false /* not an immediate request */);
2099 }
2100
2102 #if defined(OS_ANDROID) 2101 #if defined(OS_ANDROID)
2103 void RenderWidget::showUnhandledTapUIIfNeeded( 2102 void RenderWidget::showUnhandledTapUIIfNeeded(
2104 const WebPoint& tapped_position, 2103 const WebPoint& tapped_position,
2105 const WebNode& tapped_node, 2104 const WebNode& tapped_node,
2106 bool page_changed) { 2105 bool page_changed) {
2107 DCHECK(input_handler_->handling_input_event()); 2106 DCHECK(input_handler_->handling_input_event());
2108 bool should_trigger = !page_changed && tapped_node.isTextNode() && 2107 bool should_trigger = !page_changed && tapped_node.isTextNode() &&
2109 !tapped_node.isContentEditable() && 2108 !tapped_node.isContentEditable() &&
2110 !tapped_node.isInsideFocusableElementOrARIAWidget(); 2109 !tapped_node.isInsideFocusableElementOrARIAWidget();
2111 if (should_trigger) { 2110 if (should_trigger) {
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
2272 // browser side (https://crbug.com/669219). 2271 // browser side (https://crbug.com/669219).
2273 // If there is no WebFrameWidget, then there will be no 2272 // If there is no WebFrameWidget, then there will be no
2274 // InputMethodControllers for a WebLocalFrame. 2273 // InputMethodControllers for a WebLocalFrame.
2275 return nullptr; 2274 return nullptr;
2276 } 2275 }
2277 return static_cast<blink::WebFrameWidget*>(GetWebWidget()) 2276 return static_cast<blink::WebFrameWidget*>(GetWebWidget())
2278 ->getActiveWebInputMethodController(); 2277 ->getActiveWebInputMethodController();
2279 } 2278 }
2280 2279
2281 } // namespace content 2280 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_widget.h ('k') | third_party/WebKit/Source/core/editing/InputMethodController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698