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 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1149 | 1149 |
1150 RefPtrWillBeRawPtr<Range> range = frame()->selection().toNormalizedRange(); | 1150 RefPtrWillBeRawPtr<Range> range = frame()->selection().toNormalizedRange(); |
1151 if (!range) | 1151 if (!range) |
1152 return WebString(); | 1152 return WebString(); |
1153 | 1153 |
1154 return createMarkup(range.get(), 0, AnnotateForInterchange, false, ResolveNo
nLocalURLs); | 1154 return createMarkup(range.get(), 0, AnnotateForInterchange, false, ResolveNo
nLocalURLs); |
1155 } | 1155 } |
1156 | 1156 |
1157 void WebLocalFrameImpl::selectWordAroundPosition(LocalFrame* frame, VisiblePosit
ion position) | 1157 void WebLocalFrameImpl::selectWordAroundPosition(LocalFrame* frame, VisiblePosit
ion position) |
1158 { | 1158 { |
1159 VisibleSelection selection(position); | 1159 frame->selection().selectWordAroundPosition(position); |
1160 selection.expandUsingGranularity(WordGranularity); | |
1161 | |
1162 TextGranularity granularity = selection.isRange() ? WordGranularity : Charac
terGranularity; | |
1163 frame->selection().setSelection(selection, granularity); | |
1164 } | 1160 } |
1165 | 1161 |
1166 bool WebLocalFrameImpl::selectWordAroundCaret() | 1162 bool WebLocalFrameImpl::selectWordAroundCaret() |
1167 { | 1163 { |
1168 FrameSelection& selection = frame()->selection(); | 1164 FrameSelection& selection = frame()->selection(); |
1169 if (selection.isNone() || selection.isRange()) | 1165 if (selection.isNone() || selection.isRange()) |
1170 return false; | 1166 return false; |
1171 selectWordAroundPosition(frame(), selection.selection().visibleStart()); | 1167 return frame()->selection().selectWordAroundPosition(selection.selection().v
isibleStart()); |
1172 return true; | |
1173 } | 1168 } |
1174 | 1169 |
1175 void WebLocalFrameImpl::selectRange(const WebPoint& base, const WebPoint& extent
) | 1170 void WebLocalFrameImpl::selectRange(const WebPoint& base, const WebPoint& extent
) |
1176 { | 1171 { |
1177 moveRangeSelection(base, extent); | 1172 moveRangeSelection(base, extent); |
1178 } | 1173 } |
1179 | 1174 |
1180 void WebLocalFrameImpl::selectRange(const WebRange& webRange) | 1175 void WebLocalFrameImpl::selectRange(const WebRange& webRange) |
1181 { | 1176 { |
1182 if (RefPtrWillBeRawPtr<Range> range = static_cast<PassRefPtrWillBeRawPtr<Ran
ge> >(webRange)) | 1177 if (RefPtrWillBeRawPtr<Range> range = static_cast<PassRefPtrWillBeRawPtr<Ran
ge> >(webRange)) |
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1973 | 1968 |
1974 void WebLocalFrameImpl::invalidateAll() const | 1969 void WebLocalFrameImpl::invalidateAll() const |
1975 { | 1970 { |
1976 ASSERT(frame() && frame()->view()); | 1971 ASSERT(frame() && frame()->view()); |
1977 FrameView* view = frame()->view(); | 1972 FrameView* view = frame()->view(); |
1978 view->invalidateRect(view->frameRect()); | 1973 view->invalidateRect(view->frameRect()); |
1979 invalidateScrollbar(); | 1974 invalidateScrollbar(); |
1980 } | 1975 } |
1981 | 1976 |
1982 } // namespace blink | 1977 } // namespace blink |
OLD | NEW |