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

Unified Diff: content/renderer/text_input_client_observer.cc

Issue 2012823003: Move IME related functions from WebFrame to WebLocalFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add CHECK in TextInputController::HasMarkedText() Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/text_input_client_observer.cc
diff --git a/content/renderer/text_input_client_observer.cc b/content/renderer/text_input_client_observer.cc
index 3c953eebaad238155ab72433c28dbed90b5422e2..d738e546268b1c475692d022545a196e63586b95 100644
--- a/content/renderer/text_input_client_observer.cc
+++ b/content/renderer/text_input_client_observer.cc
@@ -87,13 +87,10 @@ void TextInputClientObserver::OnFirstRectForCharacterRange(gfx::Range range) {
} else
#endif
{
- blink::WebFrame* frame = webview()->focusedFrame();
- if (frame) {
- blink::WebRect web_rect;
- frame->firstRectForCharacterRange(range.start(), range.length(),
- web_rect);
- rect = web_rect;
- }
+ blink::WebLocalFrame* frame = webview()->focusedFrame();
+ blink::WebRect web_rect;
+ frame->firstRectForCharacterRange(range.start(), range.length(), web_rect);
+ rect = web_rect;
}
Send(new TextInputClientReplyMsg_GotFirstRectForRange(routing_id(), rect));
}
@@ -102,11 +99,9 @@ void TextInputClientObserver::OnStringForRange(gfx::Range range) {
#if defined(OS_MACOSX)
blink::WebPoint baselinePoint;
NSAttributedString* string = nil;
- blink::WebLocalFrame* frame = webview()->focusedFrame()->toWebLocalFrame();
- if (frame) {
- string = blink::WebSubstringUtil::attributedSubstringInRange(
- frame, range.start(), range.length(), &baselinePoint);
- }
+ blink::WebLocalFrame* frame = webview()->focusedFrame();
+ string = blink::WebSubstringUtil::attributedSubstringInRange(
+ frame, range.start(), range.length(), &baselinePoint);
std::unique_ptr<const mac::AttributedStringCoder::EncodedString> encoded(
mac::AttributedStringCoder::Encode(string));
Send(new TextInputClientReplyMsg_GotStringForRange(routing_id(),
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698