| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 1920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1931 if (m_granularityStrategy && m_granularityStrategy->GetType() == strategyTyp
e) | 1931 if (m_granularityStrategy && m_granularityStrategy->GetType() == strategyTyp
e) |
| 1932 return m_granularityStrategy.get(); | 1932 return m_granularityStrategy.get(); |
| 1933 | 1933 |
| 1934 if (strategyType == SelectionStrategy::Direction) | 1934 if (strategyType == SelectionStrategy::Direction) |
| 1935 m_granularityStrategy = adoptPtr(new DirectionGranularityStrategy()); | 1935 m_granularityStrategy = adoptPtr(new DirectionGranularityStrategy()); |
| 1936 else | 1936 else |
| 1937 m_granularityStrategy = adoptPtr(new CharacterGranularityStrategy()); | 1937 m_granularityStrategy = adoptPtr(new CharacterGranularityStrategy()); |
| 1938 return m_granularityStrategy.get(); | 1938 return m_granularityStrategy.get(); |
| 1939 } | 1939 } |
| 1940 | 1940 |
| 1941 void FrameSelection::moveRangeSelectionExtent(const VisiblePosition& extentPosit
ion) | 1941 void FrameSelection::moveRangeSelectionExtent(const IntPoint& contentsPoint) |
| 1942 { | 1942 { |
| 1943 if (isNone() || m_selection.visibleBase() == extentPosition) | 1943 TRACE_EVENT0("blink", "FrameSelection::moveRangeSelectionExtent"); |
| 1944 if (isNone()) |
| 1944 return; | 1945 return; |
| 1945 | 1946 |
| 1946 VisibleSelection newSelection = granularityStrategy()->updateExtent(extentPo
sition, selection()); | 1947 VisibleSelection newSelection = granularityStrategy()->updateExtent(contents
Point, m_frame); |
| 1947 setSelection( | 1948 setSelection( |
| 1948 newSelection, | 1949 newSelection, |
| 1949 FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle | FrameSe
lection::DoNotClearStrategy | UserTriggered, | 1950 FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle | FrameSe
lection::DoNotClearStrategy | UserTriggered, |
| 1950 FrameSelection::AlignCursorOnScrollIfNeeded, | 1951 FrameSelection::AlignCursorOnScrollIfNeeded, |
| 1951 CharacterGranularity); | 1952 CharacterGranularity); |
| 1952 } | 1953 } |
| 1953 | 1954 |
| 1954 void FrameSelection::moveRangeSelection(const VisiblePosition& basePosition, con
st VisiblePosition& extentPosition, TextGranularity granularity) | 1955 void FrameSelection::moveRangeSelection(const VisiblePosition& basePosition, con
st VisiblePosition& extentPosition, TextGranularity granularity) |
| 1955 { | 1956 { |
| 1956 VisibleSelection newSelection(basePosition, extentPosition); | 1957 VisibleSelection newSelection(basePosition, extentPosition); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1973 | 1974 |
| 1974 void showTree(const blink::FrameSelection* sel) | 1975 void showTree(const blink::FrameSelection* sel) |
| 1975 { | 1976 { |
| 1976 if (sel) | 1977 if (sel) |
| 1977 sel->showTreeForThis(); | 1978 sel->showTreeForThis(); |
| 1978 else | 1979 else |
| 1979 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); | 1980 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); |
| 1980 } | 1981 } |
| 1981 | 1982 |
| 1982 #endif | 1983 #endif |
| OLD | NEW |