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 |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
12 #include "content/common/text_input_client_messages.h" | 12 #include "content/common/text_input_client_messages.h" |
13 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 13 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
14 #include "content/renderer/render_view_impl.h" | 14 #include "content/renderer/render_view_impl.h" |
15 #include "third_party/WebKit/public/platform/WebPoint.h" | 15 #include "third_party/WebKit/public/platform/WebPoint.h" |
16 #include "third_party/WebKit/public/platform/WebRect.h" | 16 #include "third_party/WebKit/public/platform/WebRect.h" |
17 #include "third_party/WebKit/public/platform/WebString.h" | 17 #include "third_party/WebKit/public/platform/WebString.h" |
18 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 18 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
19 #include "third_party/WebKit/public/web/WebView.h" | 19 #include "third_party/WebKit/public/web/WebView.h" |
20 #include "third_party/WebKit/public/web/mac/WebSubstringUtil.h" | 20 #include "third_party/WebKit/public/web/mac/WebSubstringUtil.h" |
21 #include "ui/gfx/geometry/rect.h" | 21 #include "ui/gfx/geometry/rect.h" |
22 | 22 |
23 namespace content { | 23 namespace content { |
24 | 24 |
25 TextInputClientObserver::TextInputClientObserver(RenderViewImpl* render_view) | 25 TextInputClientObserver::TextInputClientObserver(RenderViewImpl* render_view) |
26 : RenderViewObserver(render_view), | 26 #if defined(ENABLE_PLUGINS) |
27 render_view_impl_(render_view) { | 27 : RenderViewObserver(render_view), render_view_impl_(render_view) { |
| 28 #else |
| 29 : RenderViewObserver(render_view) { |
| 30 #endif |
28 } | 31 } |
29 | 32 |
30 TextInputClientObserver::~TextInputClientObserver() { | 33 TextInputClientObserver::~TextInputClientObserver() { |
31 } | 34 } |
32 | 35 |
33 bool TextInputClientObserver::OnMessageReceived(const IPC::Message& message) { | 36 bool TextInputClientObserver::OnMessageReceived(const IPC::Message& message) { |
34 bool handled = true; | 37 bool handled = true; |
35 IPC_BEGIN_MESSAGE_MAP(TextInputClientObserver, message) | 38 IPC_BEGIN_MESSAGE_MAP(TextInputClientObserver, message) |
36 IPC_MESSAGE_HANDLER(TextInputClientMsg_StringAtPoint, | 39 IPC_MESSAGE_HANDLER(TextInputClientMsg_StringAtPoint, |
37 OnStringAtPoint) | 40 OnStringAtPoint) |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 std::unique_ptr<const mac::AttributedStringCoder::EncodedString> encoded( | 106 std::unique_ptr<const mac::AttributedStringCoder::EncodedString> encoded( |
104 mac::AttributedStringCoder::Encode(string)); | 107 mac::AttributedStringCoder::Encode(string)); |
105 Send(new TextInputClientReplyMsg_GotStringForRange(routing_id(), | 108 Send(new TextInputClientReplyMsg_GotStringForRange(routing_id(), |
106 *encoded.get(), baselinePoint)); | 109 *encoded.get(), baselinePoint)); |
107 #else | 110 #else |
108 NOTIMPLEMENTED(); | 111 NOTIMPLEMENTED(); |
109 #endif | 112 #endif |
110 } | 113 } |
111 | 114 |
112 } // namespace content | 115 } // namespace content |
OLD | NEW |