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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 #include "core/loader/DocumentLoader.h" | 70 #include "core/loader/DocumentLoader.h" |
71 #include "core/page/EditorClient.h" | 71 #include "core/page/EditorClient.h" |
72 #include "core/page/FocusController.h" | 72 #include "core/page/FocusController.h" |
73 #include "core/page/FrameTree.h" | 73 #include "core/page/FrameTree.h" |
74 #include "core/page/Page.h" | 74 #include "core/page/Page.h" |
75 #include "core/paint/PaintLayer.h" | 75 #include "core/paint/PaintLayer.h" |
76 #include "platform/SecureTextInput.h" | 76 #include "platform/SecureTextInput.h" |
77 #include "platform/geometry/FloatQuad.h" | 77 #include "platform/geometry/FloatQuad.h" |
78 #include "platform/graphics/GraphicsContext.h" | 78 #include "platform/graphics/GraphicsContext.h" |
79 #include "platform/text/UnicodeUtilities.h" | 79 #include "platform/text/UnicodeUtilities.h" |
80 #include "wtf/PtrUtil.h" | |
81 #include "wtf/text/CString.h" | 80 #include "wtf/text/CString.h" |
82 #include <stdio.h> | 81 #include <stdio.h> |
83 | 82 |
84 #define EDIT_DEBUG 0 | 83 #define EDIT_DEBUG 0 |
85 | 84 |
86 namespace blink { | 85 namespace blink { |
87 | 86 |
88 using namespace HTMLNames; | 87 using namespace HTMLNames; |
89 | 88 |
90 static inline bool shouldAlwaysUseDirectionalSelection(LocalFrame* frame) | 89 static inline bool shouldAlwaysUseDirectionalSelection(LocalFrame* frame) |
(...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1293 // set yet. | 1292 // set yet. |
1294 SelectionStrategy strategyType = SelectionStrategy::Character; | 1293 SelectionStrategy strategyType = SelectionStrategy::Character; |
1295 Settings* settings = m_frame ? m_frame->settings() : 0; | 1294 Settings* settings = m_frame ? m_frame->settings() : 0; |
1296 if (settings && settings->selectionStrategy() == SelectionStrategy::Directio
n) | 1295 if (settings && settings->selectionStrategy() == SelectionStrategy::Directio
n) |
1297 strategyType = SelectionStrategy::Direction; | 1296 strategyType = SelectionStrategy::Direction; |
1298 | 1297 |
1299 if (m_granularityStrategy && m_granularityStrategy->GetType() == strategyTyp
e) | 1298 if (m_granularityStrategy && m_granularityStrategy->GetType() == strategyTyp
e) |
1300 return m_granularityStrategy.get(); | 1299 return m_granularityStrategy.get(); |
1301 | 1300 |
1302 if (strategyType == SelectionStrategy::Direction) | 1301 if (strategyType == SelectionStrategy::Direction) |
1303 m_granularityStrategy = wrapUnique(new DirectionGranularityStrategy()); | 1302 m_granularityStrategy = adoptPtr(new DirectionGranularityStrategy()); |
1304 else | 1303 else |
1305 m_granularityStrategy = wrapUnique(new CharacterGranularityStrategy()); | 1304 m_granularityStrategy = adoptPtr(new CharacterGranularityStrategy()); |
1306 return m_granularityStrategy.get(); | 1305 return m_granularityStrategy.get(); |
1307 } | 1306 } |
1308 | 1307 |
1309 void FrameSelection::moveRangeSelectionExtent(const IntPoint& contentsPoint) | 1308 void FrameSelection::moveRangeSelectionExtent(const IntPoint& contentsPoint) |
1310 { | 1309 { |
1311 if (isNone()) | 1310 if (isNone()) |
1312 return; | 1311 return; |
1313 | 1312 |
1314 VisibleSelection newSelection = granularityStrategy()->updateExtent(contents
Point, m_frame); | 1313 VisibleSelection newSelection = granularityStrategy()->updateExtent(contents
Point, m_frame); |
1315 setSelection( | 1314 setSelection( |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1381 | 1380 |
1382 void showTree(const blink::FrameSelection* sel) | 1381 void showTree(const blink::FrameSelection* sel) |
1383 { | 1382 { |
1384 if (sel) | 1383 if (sel) |
1385 sel->showTreeForThis(); | 1384 sel->showTreeForThis(); |
1386 else | 1385 else |
1387 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); | 1386 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); |
1388 } | 1387 } |
1389 | 1388 |
1390 #endif | 1389 #endif |
OLD | NEW |