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