Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: Source/web/WebLocalFrameImpl.cpp

Issue 1123563003: Improving direction-based selection strategy. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 } 1242 }
1243 1243
1244 void WebLocalFrameImpl::selectRange(const WebRange& webRange) 1244 void WebLocalFrameImpl::selectRange(const WebRange& webRange)
1245 { 1245 {
1246 if (RefPtrWillBeRawPtr<Range> range = static_cast<PassRefPtrWillBeRawPtr<Ran ge>>(webRange)) 1246 if (RefPtrWillBeRawPtr<Range> range = static_cast<PassRefPtrWillBeRawPtr<Ran ge>>(webRange))
1247 frame()->selection().setSelectedRange(range.get(), VP_DEFAULT_AFFINITY, FrameSelection::NonDirectional, NotUserTriggered); 1247 frame()->selection().setSelectedRange(range.get(), VP_DEFAULT_AFFINITY, FrameSelection::NonDirectional, NotUserTriggered);
1248 } 1248 }
1249 1249
1250 void WebLocalFrameImpl::moveRangeSelectionExtent(const WebPoint& point) 1250 void WebLocalFrameImpl::moveRangeSelectionExtent(const WebPoint& point)
1251 { 1251 {
1252 frame()->selection().moveRangeSelectionExtent(visiblePositionForViewportPoin t(point)); 1252 frame()->selection().moveRangeSelectionExtent(frame()->view()->viewportToCon tents(point));
1253 } 1253 }
1254 1254
1255 void WebLocalFrameImpl::moveRangeSelection(const WebPoint& baseInViewport, const WebPoint& extentInViewport, WebFrame::TextGranularity granularity) 1255 void WebLocalFrameImpl::moveRangeSelection(const WebPoint& baseInViewport, const WebPoint& extentInViewport, WebFrame::TextGranularity granularity)
1256 { 1256 {
1257 blink::TextGranularity blinkGranularity = blink::CharacterGranularity; 1257 blink::TextGranularity blinkGranularity = blink::CharacterGranularity;
1258 if (granularity == WebFrame::WordGranularity) 1258 if (granularity == WebFrame::WordGranularity)
1259 blinkGranularity = blink::WordGranularity; 1259 blinkGranularity = blink::WordGranularity;
1260 frame()->selection().moveRangeSelection( 1260 frame()->selection().moveRangeSelection(
1261 visiblePositionForViewportPoint(baseInViewport), 1261 visiblePositionForViewportPoint(baseInViewport),
1262 visiblePositionForViewportPoint(extentInViewport), 1262 visiblePositionForViewportPoint(extentInViewport),
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after
2090 { 2090 {
2091 m_frameWidget = frameWidget; 2091 m_frameWidget = frameWidget;
2092 } 2092 }
2093 2093
2094 WebFrameWidgetImpl* WebLocalFrameImpl::frameWidget() const 2094 WebFrameWidgetImpl* WebLocalFrameImpl::frameWidget() const
2095 { 2095 {
2096 return m_frameWidget; 2096 return m_frameWidget;
2097 } 2097 }
2098 2098
2099 } // namespace blink 2099 } // namespace blink
OLDNEW
« Source/core/editing/GranularityStrategy.cpp ('K') | « Source/core/editing/VisibleSelection.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698