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

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

Issue 2592953003: Revert of [refactor] - Move textInputInfo() and textInputType() from WebWidget to WebInputMethodController (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 #include "third_party/WebKit/public/platform/WebVector.h" 182 #include "third_party/WebKit/public/platform/WebVector.h"
183 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul er.h" 183 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul er.h"
184 #include "third_party/WebKit/public/web/WebColorSuggestion.h" 184 #include "third_party/WebKit/public/web/WebColorSuggestion.h"
185 #include "third_party/WebKit/public/web/WebConsoleMessage.h" 185 #include "third_party/WebKit/public/web/WebConsoleMessage.h"
186 #include "third_party/WebKit/public/web/WebDocument.h" 186 #include "third_party/WebKit/public/web/WebDocument.h"
187 #include "third_party/WebKit/public/web/WebFindOptions.h" 187 #include "third_party/WebKit/public/web/WebFindOptions.h"
188 #include "third_party/WebKit/public/web/WebFrameOwnerProperties.h" 188 #include "third_party/WebKit/public/web/WebFrameOwnerProperties.h"
189 #include "third_party/WebKit/public/web/WebFrameSerializer.h" 189 #include "third_party/WebKit/public/web/WebFrameSerializer.h"
190 #include "third_party/WebKit/public/web/WebFrameSerializerCacheControlPolicy.h" 190 #include "third_party/WebKit/public/web/WebFrameSerializerCacheControlPolicy.h"
191 #include "third_party/WebKit/public/web/WebFrameWidget.h" 191 #include "third_party/WebKit/public/web/WebFrameWidget.h"
192 #include "third_party/WebKit/public/web/WebInputMethodController.h"
193 #include "third_party/WebKit/public/web/WebKit.h" 192 #include "third_party/WebKit/public/web/WebKit.h"
194 #include "third_party/WebKit/public/web/WebLocalFrame.h" 193 #include "third_party/WebKit/public/web/WebLocalFrame.h"
195 #include "third_party/WebKit/public/web/WebMediaStreamRegistry.h" 194 #include "third_party/WebKit/public/web/WebMediaStreamRegistry.h"
196 #include "third_party/WebKit/public/web/WebNavigationPolicy.h" 195 #include "third_party/WebKit/public/web/WebNavigationPolicy.h"
197 #include "third_party/WebKit/public/web/WebPlugin.h" 196 #include "third_party/WebKit/public/web/WebPlugin.h"
198 #include "third_party/WebKit/public/web/WebPluginContainer.h" 197 #include "third_party/WebKit/public/web/WebPluginContainer.h"
199 #include "third_party/WebKit/public/web/WebPluginDocument.h" 198 #include "third_party/WebKit/public/web/WebPluginDocument.h"
200 #include "third_party/WebKit/public/web/WebPluginParams.h" 199 #include "third_party/WebKit/public/web/WebPluginParams.h"
201 #include "third_party/WebKit/public/web/WebRange.h" 200 #include "third_party/WebKit/public/web/WebRange.h"
202 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" 201 #include "third_party/WebKit/public/web/WebScopedUserGesture.h"
(...skipping 2086 matching lines...) Expand 10 before | Expand all | Expand 10 after
2289 if (frame_ != render_view_->GetWebView()->focusedFrame() || 2288 if (frame_ != render_view_->GetWebView()->focusedFrame() ||
2290 frame_->document().focusedElement().isNull()) { 2289 frame_->document().focusedElement().isNull()) {
2291 Send(new FrameHostMsg_FocusedFormFieldDataResponse(routing_id_, request_id, 2290 Send(new FrameHostMsg_FocusedFormFieldDataResponse(routing_id_, request_id,
2292 FormFieldData())); 2291 FormFieldData()));
2293 return; 2292 return;
2294 } 2293 }
2295 2294
2296 WebElement element = frame_->document().focusedElement(); 2295 WebElement element = frame_->document().focusedElement();
2297 2296
2298 DCHECK(GetRenderWidget()->GetWebWidget()); 2297 DCHECK(GetRenderWidget()->GetWebWidget());
2299 blink::WebInputMethodController* controller =
2300 frame_->frameWidget()->getActiveWebInputMethodController();
2301 blink::WebTextInputInfo info = 2298 blink::WebTextInputInfo info =
2302 controller ? controller->textInputInfo() : blink::WebTextInputInfo(); 2299 GetRenderWidget()->GetWebWidget()->textInputInfo();
2303 FormFieldData field; 2300 FormFieldData field;
2304 field.text = info.value.utf8(); 2301 field.text = info.value.utf8();
2305 field.placeholder = element.getAttribute("placeholder").utf8(); 2302 field.placeholder = element.getAttribute("placeholder").utf8();
2306 field.text_input_type = GetRenderWidget()->GetTextInputType(); 2303 field.text_input_type = GetRenderWidget()->GetTextInputType();
2307 2304
2308 Send(new FrameHostMsg_FocusedFormFieldDataResponse(routing_id_, request_id, 2305 Send(new FrameHostMsg_FocusedFormFieldDataResponse(routing_id_, request_id,
2309 field)); 2306 field));
2310 } 2307 }
2311 2308
2312 bool RenderFrameImpl::RunJavaScriptMessage(JavaScriptMessageType type, 2309 bool RenderFrameImpl::RunJavaScriptMessage(JavaScriptMessageType type,
(...skipping 3693 matching lines...) Expand 10 before | Expand all | Expand 10 after
6006 } else 6003 } else
6007 #endif 6004 #endif
6008 { 6005 {
6009 WebRange selection = 6006 WebRange selection =
6010 GetRenderWidget()->GetWebWidget()->caretOrSelectionRange(); 6007 GetRenderWidget()->GetWebWidget()->caretOrSelectionRange();
6011 if (selection.isNull()) 6008 if (selection.isNull())
6012 return; 6009 return;
6013 6010
6014 range = gfx::Range(selection.startOffset(), selection.endOffset()); 6011 range = gfx::Range(selection.startOffset(), selection.endOffset());
6015 6012
6016 if (frame_->inputMethodController()->textInputType() != 6013 if (GetRenderWidget()->GetWebWidget()->textInputType() !=
6017 blink::WebTextInputTypeNone) { 6014 blink::WebTextInputTypeNone) {
6018 // If current focused element is editable, we will send 100 more chars 6015 // If current focused element is editable, we will send 100 more chars
6019 // before and after selection. It is for input method surrounding text 6016 // before and after selection. It is for input method surrounding text
6020 // feature. 6017 // feature.
6021 if (selection.startOffset() > kExtraCharsBeforeAndAfterSelection) 6018 if (selection.startOffset() > kExtraCharsBeforeAndAfterSelection)
6022 offset = selection.startOffset() - kExtraCharsBeforeAndAfterSelection; 6019 offset = selection.startOffset() - kExtraCharsBeforeAndAfterSelection;
6023 else 6020 else
6024 offset = 0; 6021 offset = 0;
6025 size_t length = 6022 size_t length =
6026 selection.endOffset() - offset + kExtraCharsBeforeAndAfterSelection; 6023 selection.endOffset() - offset + kExtraCharsBeforeAndAfterSelection;
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
6730 // event target. Potentially a Pepper plugin will receive the event. 6727 // event target. Potentially a Pepper plugin will receive the event.
6731 // In order to tell whether a plugin gets the last mouse event and which it 6728 // In order to tell whether a plugin gets the last mouse event and which it
6732 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6729 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6733 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6730 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6734 // |pepper_last_mouse_event_target_|. 6731 // |pepper_last_mouse_event_target_|.
6735 pepper_last_mouse_event_target_ = nullptr; 6732 pepper_last_mouse_event_target_ = nullptr;
6736 #endif 6733 #endif
6737 } 6734 }
6738 6735
6739 } // namespace content 6736 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698