| 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 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1107 AnnotateForInterchange, | 1107 AnnotateForInterchange, |
| 1108 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); | 1108 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); |
| 1109 } | 1109 } |
| 1110 | 1110 |
| 1111 String FrameSelection::selectedText(TextIteratorBehavior behavior) const { | 1111 String FrameSelection::selectedText(TextIteratorBehavior behavior) const { |
| 1112 return extractSelectedText(*this, behavior); | 1112 return extractSelectedText(*this, behavior); |
| 1113 } | 1113 } |
| 1114 | 1114 |
| 1115 String FrameSelection::selectedTextForClipboard() const { | 1115 String FrameSelection::selectedTextForClipboard() const { |
| 1116 if (m_frame->settings() && | 1116 if (m_frame->settings() && |
| 1117 m_frame->settings()->selectionIncludesAltImageText()) | 1117 m_frame->settings()->GetSelectionIncludesAltImageText()) |
| 1118 return extractSelectedText(*this, TextIteratorEmitsImageAltText); | 1118 return extractSelectedText(*this, TextIteratorEmitsImageAltText); |
| 1119 return extractSelectedText(*this, TextIteratorDefaultBehavior); | 1119 return extractSelectedText(*this, TextIteratorDefaultBehavior); |
| 1120 } | 1120 } |
| 1121 | 1121 |
| 1122 LayoutRect FrameSelection::bounds() const { | 1122 LayoutRect FrameSelection::bounds() const { |
| 1123 FrameView* view = m_frame->view(); | 1123 FrameView* view = m_frame->view(); |
| 1124 if (!view) | 1124 if (!view) |
| 1125 return LayoutRect(); | 1125 return LayoutRect(); |
| 1126 | 1126 |
| 1127 return intersection(unclippedBounds(), | 1127 return intersection(unclippedBounds(), |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1310 | 1310 |
| 1311 return false; | 1311 return false; |
| 1312 } | 1312 } |
| 1313 | 1313 |
| 1314 GranularityStrategy* FrameSelection::granularityStrategy() { | 1314 GranularityStrategy* FrameSelection::granularityStrategy() { |
| 1315 // We do lazy initalization for m_granularityStrategy, because if we | 1315 // We do lazy initalization for m_granularityStrategy, because if we |
| 1316 // initialize it right in the constructor - the correct settings may not be | 1316 // initialize it right in the constructor - the correct settings may not be |
| 1317 // set yet. | 1317 // set yet. |
| 1318 SelectionStrategy strategyType = SelectionStrategy::Character; | 1318 SelectionStrategy strategyType = SelectionStrategy::Character; |
| 1319 Settings* settings = m_frame ? m_frame->settings() : 0; | 1319 Settings* settings = m_frame ? m_frame->settings() : 0; |
| 1320 if (settings && settings->selectionStrategy() == SelectionStrategy::Direction) | 1320 if (settings && |
| 1321 settings->GetSelectionStrategy() == SelectionStrategy::Direction) |
| 1321 strategyType = SelectionStrategy::Direction; | 1322 strategyType = SelectionStrategy::Direction; |
| 1322 | 1323 |
| 1323 if (m_granularityStrategy && m_granularityStrategy->GetType() == strategyType) | 1324 if (m_granularityStrategy && m_granularityStrategy->GetType() == strategyType) |
| 1324 return m_granularityStrategy.get(); | 1325 return m_granularityStrategy.get(); |
| 1325 | 1326 |
| 1326 if (strategyType == SelectionStrategy::Direction) | 1327 if (strategyType == SelectionStrategy::Direction) |
| 1327 m_granularityStrategy = WTF::makeUnique<DirectionGranularityStrategy>(); | 1328 m_granularityStrategy = WTF::makeUnique<DirectionGranularityStrategy>(); |
| 1328 else | 1329 else |
| 1329 m_granularityStrategy = WTF::makeUnique<CharacterGranularityStrategy>(); | 1330 m_granularityStrategy = WTF::makeUnique<CharacterGranularityStrategy>(); |
| 1330 return m_granularityStrategy.get(); | 1331 return m_granularityStrategy.get(); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1406 } | 1407 } |
| 1407 | 1408 |
| 1408 void showTree(const blink::FrameSelection* sel) { | 1409 void showTree(const blink::FrameSelection* sel) { |
| 1409 if (sel) | 1410 if (sel) |
| 1410 sel->showTreeForThis(); | 1411 sel->showTreeForThis(); |
| 1411 else | 1412 else |
| 1412 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; | 1413 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; |
| 1413 } | 1414 } |
| 1414 | 1415 |
| 1415 #endif | 1416 #endif |
| OLD | NEW |