| 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 30 matching lines...) Expand all Loading... |
| 41 IPC_MESSAGE_HANDLER(TextInputClientMsg_CharacterIndexForPoint, | 41 IPC_MESSAGE_HANDLER(TextInputClientMsg_CharacterIndexForPoint, |
| 42 OnCharacterIndexForPoint) | 42 OnCharacterIndexForPoint) |
| 43 IPC_MESSAGE_HANDLER(TextInputClientMsg_FirstRectForCharacterRange, | 43 IPC_MESSAGE_HANDLER(TextInputClientMsg_FirstRectForCharacterRange, |
| 44 OnFirstRectForCharacterRange) | 44 OnFirstRectForCharacterRange) |
| 45 IPC_MESSAGE_HANDLER(TextInputClientMsg_StringForRange, OnStringForRange) | 45 IPC_MESSAGE_HANDLER(TextInputClientMsg_StringForRange, OnStringForRange) |
| 46 IPC_MESSAGE_UNHANDLED(handled = false) | 46 IPC_MESSAGE_UNHANDLED(handled = false) |
| 47 IPC_END_MESSAGE_MAP() | 47 IPC_END_MESSAGE_MAP() |
| 48 return handled; | 48 return handled; |
| 49 } | 49 } |
| 50 | 50 |
| 51 void TextInputClientObserver::OnDestruct() { |
| 52 delete this; |
| 53 } |
| 54 |
| 51 blink::WebView* TextInputClientObserver::webview() { | 55 blink::WebView* TextInputClientObserver::webview() { |
| 52 return render_view()->GetWebView(); | 56 return render_view()->GetWebView(); |
| 53 } | 57 } |
| 54 | 58 |
| 55 void TextInputClientObserver::OnStringAtPoint(gfx::Point point) { | 59 void TextInputClientObserver::OnStringAtPoint(gfx::Point point) { |
| 56 #if defined(OS_MACOSX) | 60 #if defined(OS_MACOSX) |
| 57 blink::WebPoint baselinePoint; | 61 blink::WebPoint baselinePoint; |
| 58 NSAttributedString* string = blink::WebSubstringUtil::attributedWordAtPoint( | 62 NSAttributedString* string = blink::WebSubstringUtil::attributedWordAtPoint( |
| 59 webview(), point, baselinePoint); | 63 webview(), point, baselinePoint); |
| 60 | 64 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 std::unique_ptr<const mac::AttributedStringCoder::EncodedString> encoded( | 110 std::unique_ptr<const mac::AttributedStringCoder::EncodedString> encoded( |
| 107 mac::AttributedStringCoder::Encode(string)); | 111 mac::AttributedStringCoder::Encode(string)); |
| 108 Send(new TextInputClientReplyMsg_GotStringForRange(routing_id(), | 112 Send(new TextInputClientReplyMsg_GotStringForRange(routing_id(), |
| 109 *encoded.get(), baselinePoint)); | 113 *encoded.get(), baselinePoint)); |
| 110 #else | 114 #else |
| 111 NOTIMPLEMENTED(); | 115 NOTIMPLEMENTED(); |
| 112 #endif | 116 #endif |
| 113 } | 117 } |
| 114 | 118 |
| 115 } // namespace content | 119 } // namespace content |
| OLD | NEW |