| 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 "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 mac::AttributedStringCoder::Encode(string)); | 58 mac::AttributedStringCoder::Encode(string)); |
| 59 Send(new TextInputClientReplyMsg_GotStringAtPoint( | 59 Send(new TextInputClientReplyMsg_GotStringAtPoint( |
| 60 routing_id(), *encoded.get(), baselinePoint)); | 60 routing_id(), *encoded.get(), baselinePoint)); |
| 61 #else | 61 #else |
| 62 NOTIMPLEMENTED(); | 62 NOTIMPLEMENTED(); |
| 63 #endif | 63 #endif |
| 64 } | 64 } |
| 65 | 65 |
| 66 void TextInputClientObserver::OnCharacterIndexForPoint(gfx::Point point) { | 66 void TextInputClientObserver::OnCharacterIndexForPoint(gfx::Point point) { |
| 67 blink::WebPoint web_point(point); | 67 blink::WebPoint web_point(point); |
| 68 size_t index = webview()->focusedFrame()->characterIndexForPoint(web_point); | 68 uint32_t index = static_cast<uint32_t>( |
| 69 webview()->focusedFrame()->characterIndexForPoint(web_point)); |
| 69 Send(new TextInputClientReplyMsg_GotCharacterIndexForPoint(routing_id(), | 70 Send(new TextInputClientReplyMsg_GotCharacterIndexForPoint(routing_id(), |
| 70 index)); | 71 index)); |
| 71 } | 72 } |
| 72 | 73 |
| 73 void TextInputClientObserver::OnFirstRectForCharacterRange(gfx::Range range) { | 74 void TextInputClientObserver::OnFirstRectForCharacterRange(gfx::Range range) { |
| 74 gfx::Rect rect; | 75 gfx::Rect rect; |
| 75 #if defined(ENABLE_PLUGINS) | 76 #if defined(ENABLE_PLUGINS) |
| 76 if (render_view_impl_->focused_pepper_plugin()) { | 77 if (render_view_impl_->focused_pepper_plugin()) { |
| 77 rect = render_view_impl_->focused_pepper_plugin()->GetCaretBounds(); | 78 rect = render_view_impl_->focused_pepper_plugin()->GetCaretBounds(); |
| 78 } else | 79 } else |
| (...skipping 22 matching lines...) Expand all Loading... |
| 101 scoped_ptr<const mac::AttributedStringCoder::EncodedString> encoded( | 102 scoped_ptr<const mac::AttributedStringCoder::EncodedString> encoded( |
| 102 mac::AttributedStringCoder::Encode(string)); | 103 mac::AttributedStringCoder::Encode(string)); |
| 103 Send(new TextInputClientReplyMsg_GotStringForRange(routing_id(), | 104 Send(new TextInputClientReplyMsg_GotStringForRange(routing_id(), |
| 104 *encoded.get(), baselinePoint)); | 105 *encoded.get(), baselinePoint)); |
| 105 #else | 106 #else |
| 106 NOTIMPLEMENTED(); | 107 NOTIMPLEMENTED(); |
| 107 #endif | 108 #endif |
| 108 } | 109 } |
| 109 | 110 |
| 110 } // namespace content | 111 } // namespace content |
| OLD | NEW |