| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1139 } | 1139 } |
| 1140 | 1140 |
| 1141 void WebLocalFrameImpl::replaceMisspelledRange(const WebString& text) | 1141 void WebLocalFrameImpl::replaceMisspelledRange(const WebString& text) |
| 1142 { | 1142 { |
| 1143 // If this caret selection has two or more markers, this function replace th
e range covered by the first marker with the specified word as Microsoft Word do
es. | 1143 // If this caret selection has two or more markers, this function replace th
e range covered by the first marker with the specified word as Microsoft Word do
es. |
| 1144 if (pluginContainerFromFrame(frame())) | 1144 if (pluginContainerFromFrame(frame())) |
| 1145 return; | 1145 return; |
| 1146 RefPtrWillBeRawPtr<Range> caretRange = frame()->selection().toNormalizedRang
e(); | 1146 RefPtrWillBeRawPtr<Range> caretRange = frame()->selection().toNormalizedRang
e(); |
| 1147 if (!caretRange) | 1147 if (!caretRange) |
| 1148 return; | 1148 return; |
| 1149 Vector<DocumentMarker*> markers = frame()->document()->markers().markersInRa
nge(caretRange.get(), DocumentMarker::MisspellingMarkers()); | 1149 WillBeHeapVector<DocumentMarker*> markers = frame()->document()->markers().m
arkersInRange(caretRange.get(), DocumentMarker::MisspellingMarkers()); |
| 1150 if (markers.size() < 1 || markers[0]->startOffset() >= markers[0]->endOffset
()) | 1150 if (markers.size() < 1 || markers[0]->startOffset() >= markers[0]->endOffset
()) |
| 1151 return; | 1151 return; |
| 1152 RefPtrWillBeRawPtr<Range> markerRange = Range::create(caretRange->ownerDocum
ent(), caretRange->startContainer(), markers[0]->startOffset(), caretRange->endC
ontainer(), markers[0]->endOffset()); | 1152 RefPtrWillBeRawPtr<Range> markerRange = Range::create(caretRange->ownerDocum
ent(), caretRange->startContainer(), markers[0]->startOffset(), caretRange->endC
ontainer(), markers[0]->endOffset()); |
| 1153 if (!markerRange) | 1153 if (!markerRange) |
| 1154 return; | 1154 return; |
| 1155 frame()->selection().setSelection(VisibleSelection(markerRange.get()), Chara
cterGranularity); | 1155 frame()->selection().setSelection(VisibleSelection(markerRange.get()), Chara
cterGranularity); |
| 1156 frame()->editor().replaceSelectionWithText(text, false, false); | 1156 frame()->editor().replaceSelectionWithText(text, false, false); |
| 1157 } | 1157 } |
| 1158 | 1158 |
| 1159 void WebLocalFrameImpl::removeSpellingMarkers() | 1159 void WebLocalFrameImpl::removeSpellingMarkers() |
| (...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1901 | 1901 |
| 1902 void WebLocalFrameImpl::invalidateAll() const | 1902 void WebLocalFrameImpl::invalidateAll() const |
| 1903 { | 1903 { |
| 1904 ASSERT(frame() && frame()->view()); | 1904 ASSERT(frame() && frame()->view()); |
| 1905 FrameView* view = frame()->view(); | 1905 FrameView* view = frame()->view(); |
| 1906 view->invalidateRect(view->frameRect()); | 1906 view->invalidateRect(view->frameRect()); |
| 1907 invalidateScrollbar(); | 1907 invalidateScrollbar(); |
| 1908 } | 1908 } |
| 1909 | 1909 |
| 1910 } // namespace blink | 1910 } // namespace blink |
| OLD | NEW |