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 "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "content/common/text_input_client_messages.h" | 8 #include "content/common/text_input_client_messages.h" |
9 #include "content/renderer/render_view_impl.h" | 9 #include "content/renderer/render_view_impl.h" |
10 #include "ipc/ipc_message_macros.h" | |
11 #include "third_party/WebKit/Source/WebKit/chromium/public/mac/WebSubstringUtil.
h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/mac/WebSubstringUtil.
h" |
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
13 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h" | 12 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h" |
14 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" |
15 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
17 #include "ui/gfx/rect.h" | 16 #include "ui/gfx/rect.h" |
18 | 17 |
| 18 namespace content { |
| 19 |
19 TextInputClientObserver::TextInputClientObserver(RenderViewImpl* render_view) | 20 TextInputClientObserver::TextInputClientObserver(RenderViewImpl* render_view) |
20 : content::RenderViewObserver(render_view), | 21 : RenderViewObserver(render_view), |
21 render_view_impl_(render_view) { | 22 render_view_impl_(render_view) { |
22 } | 23 } |
23 | 24 |
24 TextInputClientObserver::~TextInputClientObserver() { | 25 TextInputClientObserver::~TextInputClientObserver() { |
25 } | 26 } |
26 | 27 |
27 bool TextInputClientObserver::OnMessageReceived(const IPC::Message& message) { | 28 bool TextInputClientObserver::OnMessageReceived(const IPC::Message& message) { |
28 bool handled = true; | 29 bool handled = true; |
29 IPC_BEGIN_MESSAGE_MAP(TextInputClientObserver, message) | 30 IPC_BEGIN_MESSAGE_MAP(TextInputClientObserver, message) |
30 IPC_MESSAGE_HANDLER(TextInputClientMsg_CharacterIndexForPoint, | 31 IPC_MESSAGE_HANDLER(TextInputClientMsg_CharacterIndexForPoint, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 WebKit::WebSubstringUtil::attributedSubstringInRange( | 66 WebKit::WebSubstringUtil::attributedSubstringInRange( |
66 webview()->focusedFrame(), range.start(), range.length()); | 67 webview()->focusedFrame(), range.start(), range.length()); |
67 scoped_ptr<const mac::AttributedStringCoder::EncodedString> encoded( | 68 scoped_ptr<const mac::AttributedStringCoder::EncodedString> encoded( |
68 mac::AttributedStringCoder::Encode(string)); | 69 mac::AttributedStringCoder::Encode(string)); |
69 Send(new TextInputClientReplyMsg_GotStringForRange(routing_id(), | 70 Send(new TextInputClientReplyMsg_GotStringForRange(routing_id(), |
70 *encoded.get())); | 71 *encoded.get())); |
71 #else | 72 #else |
72 NOTIMPLEMENTED(); | 73 NOTIMPLEMENTED(); |
73 #endif | 74 #endif |
74 } | 75 } |
| 76 |
| 77 } // namespace content |
OLD | NEW |