| 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/renderer/text_input_client_observer.h" | 5 #include "content/renderer/text_input_client_observer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 blink::WebPoint web_point(point); | 68 blink::WebPoint web_point(point); |
| 69 uint32_t index = static_cast<uint32_t>( | 69 uint32_t index = static_cast<uint32_t>( |
| 70 webview()->focusedFrame()->characterIndexForPoint(web_point)); | 70 webview()->focusedFrame()->characterIndexForPoint(web_point)); |
| 71 Send(new TextInputClientReplyMsg_GotCharacterIndexForPoint(routing_id(), | 71 Send(new TextInputClientReplyMsg_GotCharacterIndexForPoint(routing_id(), |
| 72 index)); | 72 index)); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void TextInputClientObserver::OnFirstRectForCharacterRange(gfx::Range range) { | 75 void TextInputClientObserver::OnFirstRectForCharacterRange(gfx::Range range) { |
| 76 gfx::Rect rect; | 76 gfx::Rect rect; |
| 77 #if defined(ENABLE_PLUGINS) | 77 #if defined(ENABLE_PLUGINS) |
| 78 if (render_view_impl_->focused_pepper_plugin()) { | 78 if (render_view_impl_->GetFocusedPepperPlugin()) { |
| 79 rect = render_view_impl_->focused_pepper_plugin()->GetCaretBounds(); | 79 rect = render_view_impl_->GetFocusedPepperPlugin()->GetCaretBounds(); |
| 80 } else | 80 } else |
| 81 #endif | 81 #endif |
| 82 { | 82 { |
| 83 blink::WebFrame* frame = webview()->focusedFrame(); | 83 blink::WebFrame* frame = webview()->focusedFrame(); |
| 84 if (frame) { | 84 if (frame) { |
| 85 blink::WebRect web_rect; | 85 blink::WebRect web_rect; |
| 86 frame->firstRectForCharacterRange(range.start(), range.length(), | 86 frame->firstRectForCharacterRange(range.start(), range.length(), |
| 87 web_rect); | 87 web_rect); |
| 88 rect = web_rect; | 88 rect = web_rect; |
| 89 } | 89 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 103 std::unique_ptr<const mac::AttributedStringCoder::EncodedString> encoded( | 103 std::unique_ptr<const mac::AttributedStringCoder::EncodedString> encoded( |
| 104 mac::AttributedStringCoder::Encode(string)); | 104 mac::AttributedStringCoder::Encode(string)); |
| 105 Send(new TextInputClientReplyMsg_GotStringForRange(routing_id(), | 105 Send(new TextInputClientReplyMsg_GotStringForRange(routing_id(), |
| 106 *encoded.get(), baselinePoint)); | 106 *encoded.get(), baselinePoint)); |
| 107 #else | 107 #else |
| 108 NOTIMPLEMENTED(); | 108 NOTIMPLEMENTED(); |
| 109 #endif | 109 #endif |
| 110 } | 110 } |
| 111 | 111 |
| 112 } // namespace content | 112 } // namespace content |
| OLD | NEW |