| 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_frame_impl.h" | 14 #include "content/renderer/render_frame_impl.h" |
| 15 #include "content/renderer/render_view_impl.h" | 15 #include "content/renderer/render_view_impl.h" |
| 16 #include "content/renderer/render_widget.h" | 16 #include "content/renderer/render_widget.h" |
| 17 #include "ipc/ipc_message.h" | 17 #include "ipc/ipc_message.h" |
| 18 #include "ppapi/features/features.h" | 18 #include "ppapi/features/features.h" |
| 19 #include "third_party/WebKit/public/platform/WebPoint.h" | 19 #include "third_party/WebKit/public/platform/WebPoint.h" |
| 20 #include "third_party/WebKit/public/platform/WebRect.h" | 20 #include "third_party/WebKit/public/platform/WebRect.h" |
| 21 #include "third_party/WebKit/public/platform/WebString.h" | 21 #include "third_party/WebKit/public/platform/WebString.h" |
| 22 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 22 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
| 23 #include "third_party/WebKit/public/web/WebView.h" | 23 #include "third_party/WebKit/public/web/WebView.h" |
| 24 #include "ui/gfx/geometry/rect.h" |
| 25 |
| 26 #if defined(OS_MACOSX) |
| 24 #include "third_party/WebKit/public/web/mac/WebSubstringUtil.h" | 27 #include "third_party/WebKit/public/web/mac/WebSubstringUtil.h" |
| 25 #include "ui/gfx/geometry/rect.h" | 28 #endif |
| 26 | 29 |
| 27 namespace content { | 30 namespace content { |
| 28 | 31 |
| 29 namespace { | 32 namespace { |
| 30 uint32_t GetCurrentCursorPositionInFrame(blink::WebLocalFrame* localFrame) { | 33 uint32_t GetCurrentCursorPositionInFrame(blink::WebLocalFrame* localFrame) { |
| 31 blink::WebRange range = localFrame->selectionRange(); | 34 blink::WebRange range = localFrame->selectionRange(); |
| 32 return range.isNull() ? 0U : static_cast<uint32_t>(range.startOffset()); | 35 return range.isNull() ? 0U : static_cast<uint32_t>(range.startOffset()); |
| 33 } | 36 } |
| 34 } | 37 } |
| 35 | 38 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 std::unique_ptr<const mac::AttributedStringCoder::EncodedString> encoded( | 169 std::unique_ptr<const mac::AttributedStringCoder::EncodedString> encoded( |
| 167 mac::AttributedStringCoder::Encode(string)); | 170 mac::AttributedStringCoder::Encode(string)); |
| 168 Send(new TextInputClientReplyMsg_GotStringForRange( | 171 Send(new TextInputClientReplyMsg_GotStringForRange( |
| 169 render_widget_->routing_id(), *encoded.get(), baselinePoint)); | 172 render_widget_->routing_id(), *encoded.get(), baselinePoint)); |
| 170 #else | 173 #else |
| 171 NOTIMPLEMENTED(); | 174 NOTIMPLEMENTED(); |
| 172 #endif | 175 #endif |
| 173 } | 176 } |
| 174 | 177 |
| 175 } // namespace content | 178 } // namespace content |
| OLD | NEW |