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 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1241 { | 1241 { |
1242 moveRangeSelection(baseInViewport, extentInViewport); | 1242 moveRangeSelection(baseInViewport, extentInViewport); |
1243 } | 1243 } |
1244 | 1244 |
1245 void WebLocalFrameImpl::selectRange(const WebRange& webRange) | 1245 void WebLocalFrameImpl::selectRange(const WebRange& webRange) |
1246 { | 1246 { |
1247 if (RefPtrWillBeRawPtr<Range> range = static_cast<PassRefPtrWillBeRawPtr<Ran
ge>>(webRange)) | 1247 if (RefPtrWillBeRawPtr<Range> range = static_cast<PassRefPtrWillBeRawPtr<Ran
ge>>(webRange)) |
1248 frame()->selection().setSelectedRange(range.get(), VP_DEFAULT_AFFINITY,
FrameSelection::NonDirectional, NotUserTriggered); | 1248 frame()->selection().setSelectedRange(range.get(), VP_DEFAULT_AFFINITY,
FrameSelection::NonDirectional, NotUserTriggered); |
1249 } | 1249 } |
1250 | 1250 |
1251 void WebLocalFrameImpl::moveRangeSelectionExtent(const WebPoint& pointInViewport
, WebFrame::TextGranularity granularity) | 1251 void WebLocalFrameImpl::moveRangeSelectionExtent(const WebPoint& point) |
1252 { | 1252 { |
1253 blink::TextGranularity blinkGranularity = blink::CharacterGranularity; | 1253 frame()->selection().moveRangeSelectionExtent(visiblePositionForViewportPoin
t(point)); |
1254 if (granularity == WebFrame::WordGranularity) | |
1255 blinkGranularity = blink::WordGranularity; | |
1256 frame()->selection().moveRangeSelectionExtent(visiblePositionForViewportPoin
t(pointInViewport), blinkGranularity); | |
1257 } | 1254 } |
1258 | 1255 |
1259 void WebLocalFrameImpl::moveRangeSelection(const WebPoint& baseInViewport, const
WebPoint& extentInViewport, WebFrame::TextGranularity granularity) | 1256 void WebLocalFrameImpl::moveRangeSelection(const WebPoint& baseInViewport, const
WebPoint& extentInViewport, WebFrame::TextGranularity granularity) |
1260 { | 1257 { |
1261 blink::TextGranularity blinkGranularity = blink::CharacterGranularity; | 1258 blink::TextGranularity blinkGranularity = blink::CharacterGranularity; |
1262 if (granularity == WebFrame::WordGranularity) | 1259 if (granularity == WebFrame::WordGranularity) |
1263 blinkGranularity = blink::WordGranularity; | 1260 blinkGranularity = blink::WordGranularity; |
1264 frame()->selection().moveRangeSelection( | 1261 frame()->selection().moveRangeSelection( |
1265 visiblePositionForViewportPoint(baseInViewport), | 1262 visiblePositionForViewportPoint(baseInViewport), |
1266 visiblePositionForViewportPoint(extentInViewport), | 1263 visiblePositionForViewportPoint(extentInViewport), |
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2111 { | 2108 { |
2112 m_frameWidget = frameWidget; | 2109 m_frameWidget = frameWidget; |
2113 } | 2110 } |
2114 | 2111 |
2115 WebFrameWidgetImpl* WebLocalFrameImpl::frameWidget() const | 2112 WebFrameWidgetImpl* WebLocalFrameImpl::frameWidget() const |
2116 { | 2113 { |
2117 return m_frameWidget; | 2114 return m_frameWidget; |
2118 } | 2115 } |
2119 | 2116 |
2120 } // namespace blink | 2117 } // namespace blink |
OLD | NEW |