| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <ctype.h> | 5 #include <ctype.h> |
| 6 #include "config.h" | 6 #include "config.h" |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 | 9 |
| 10 MSVC_PUSH_WARNING_LEVEL(0); | 10 MSVC_PUSH_WARNING_LEVEL(0); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 void WebTextInputImpl::AttributedSubstringFromRange(int32_t location, | 106 void WebTextInputImpl::AttributedSubstringFromRange(int32_t location, |
| 107 int32_t length) { | 107 int32_t length) { |
| 108 } | 108 } |
| 109 | 109 |
| 110 void WebTextInputImpl::MarkedRange(std::string* range_str) { | 110 void WebTextInputImpl::MarkedRange(std::string* range_str) { |
| 111 RefPtr<WebCore::Range> range = GetEditor()->compositionRange(); | 111 RefPtr<WebCore::Range> range = GetEditor()->compositionRange(); |
| 112 | 112 |
| 113 // Range::toString() returns a string different from what test expects. | 113 // Range::toString() returns a string different from what test expects. |
| 114 // So we need to construct the string ourselves. | 114 // So we need to construct the string ourselves. |
| 115 SStringPrintf(range_str, "%d,%d", range->startPosition().m_offset, | 115 SStringPrintf(range_str, "%d,%d", range->startPosition().deprecatedEditingOffs
et(), |
| 116 range->endPosition().m_offset); | 116 range->endPosition().deprecatedEditingOffset()); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void WebTextInputImpl::SelectedRange(std::string* range_str) { | 119 void WebTextInputImpl::SelectedRange(std::string* range_str) { |
| 120 WTF::RefPtr<WebCore::Range> range | 120 WTF::RefPtr<WebCore::Range> range |
| 121 = GetFrame()->selection()->toNormalizedRange(); | 121 = GetFrame()->selection()->toNormalizedRange(); |
| 122 | 122 |
| 123 // Range::toString() returns a string different from what test expects. | 123 // Range::toString() returns a string different from what test expects. |
| 124 // So we need to construct the string ourselves. | 124 // So we need to construct the string ourselves. |
| 125 SStringPrintf(range_str, "%d,%d", range.get()->startPosition().m_offset, | 125 SStringPrintf(range_str, "%d,%d", range.get()->startPosition().deprecatedEditi
ngOffset(), |
| 126 range.get()->endPosition().m_offset); | 126 range.get()->endPosition().deprecatedEditingOffset()); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void WebTextInputImpl::FirstRectForCharacterRange(int32_t location, | 129 void WebTextInputImpl::FirstRectForCharacterRange(int32_t location, |
| 130 int32_t length) { | 130 int32_t length) { |
| 131 } | 131 } |
| 132 | 132 |
| 133 void WebTextInputImpl::CharacterIndexForPoint(double x, double y) { | 133 void WebTextInputImpl::CharacterIndexForPoint(double x, double y) { |
| 134 } | 134 } |
| 135 | 135 |
| 136 void WebTextInputImpl::ValidAttributesForMarkedText(std::string* attributes) { | 136 void WebTextInputImpl::ValidAttributesForMarkedText(std::string* attributes) { |
| 137 // We simply return a string with relevant keywords. | 137 // We simply return a string with relevant keywords. |
| 138 attributes->assign("NSUnderline,NSUnderlineColor,NSMarkedClauseSegment,NSTextI
nputReplacementRangeAttributeName"); | 138 attributes->assign("NSUnderline,NSUnderlineColor,NSMarkedClauseSegment,NSTextI
nputReplacementRangeAttributeName"); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void WebTextInputImpl::MakeAttributedString(const std::string& str) { | 141 void WebTextInputImpl::MakeAttributedString(const std::string& str) { |
| 142 } | 142 } |
| 143 | 143 |
| 144 void WebTextInputImpl::DeleteToEndOfParagraph() { | 144 void WebTextInputImpl::DeleteToEndOfParagraph() { |
| 145 WebCore::Editor* editor = GetEditor(); | 145 WebCore::Editor* editor = GetEditor(); |
| 146 if (!editor->deleteWithDirection(WebCore::SelectionController::FORWARD, | 146 if (!editor->deleteWithDirection(WebCore::SelectionController::FORWARD, |
| 147 WebCore::ParagraphBoundary, | 147 WebCore::ParagraphBoundary, |
| 148 true, | 148 true, |
| 149 false)) { | 149 false)) { |
| 150 editor->deleteWithDirection(WebCore::SelectionController::FORWARD, | 150 editor->deleteWithDirection(WebCore::SelectionController::FORWARD, |
| 151 WebCore::CharacterGranularity, | 151 WebCore::CharacterGranularity, |
| 152 true, | 152 true, |
| 153 false); | 153 false); |
| 154 } | 154 } |
| 155 } | 155 } |
| OLD | NEW |