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

Side by Side Diff: third_party/WebKit/Source/core/editing/FrameSelection.cpp

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. Created 4 years, 6 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) 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
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"
80 #include "wtf/text/CString.h" 81 #include "wtf/text/CString.h"
81 #include <stdio.h> 82 #include <stdio.h>
82 83
83 #define EDIT_DEBUG 0 84 #define EDIT_DEBUG 0
84 85
85 namespace blink { 86 namespace blink {
86 87
87 using namespace HTMLNames; 88 using namespace HTMLNames;
88 89
89 static inline bool shouldAlwaysUseDirectionalSelection(LocalFrame* frame) 90 static inline bool shouldAlwaysUseDirectionalSelection(LocalFrame* frame)
(...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 // set yet. 1293 // set yet.
1293 SelectionStrategy strategyType = SelectionStrategy::Character; 1294 SelectionStrategy strategyType = SelectionStrategy::Character;
1294 Settings* settings = m_frame ? m_frame->settings() : 0; 1295 Settings* settings = m_frame ? m_frame->settings() : 0;
1295 if (settings && settings->selectionStrategy() == SelectionStrategy::Directio n) 1296 if (settings && settings->selectionStrategy() == SelectionStrategy::Directio n)
1296 strategyType = SelectionStrategy::Direction; 1297 strategyType = SelectionStrategy::Direction;
1297 1298
1298 if (m_granularityStrategy && m_granularityStrategy->GetType() == strategyTyp e) 1299 if (m_granularityStrategy && m_granularityStrategy->GetType() == strategyTyp e)
1299 return m_granularityStrategy.get(); 1300 return m_granularityStrategy.get();
1300 1301
1301 if (strategyType == SelectionStrategy::Direction) 1302 if (strategyType == SelectionStrategy::Direction)
1302 m_granularityStrategy = adoptPtr(new DirectionGranularityStrategy()); 1303 m_granularityStrategy = wrapUnique(new DirectionGranularityStrategy());
1303 else 1304 else
1304 m_granularityStrategy = adoptPtr(new CharacterGranularityStrategy()); 1305 m_granularityStrategy = wrapUnique(new CharacterGranularityStrategy());
1305 return m_granularityStrategy.get(); 1306 return m_granularityStrategy.get();
1306 } 1307 }
1307 1308
1308 void FrameSelection::moveRangeSelectionExtent(const IntPoint& contentsPoint) 1309 void FrameSelection::moveRangeSelectionExtent(const IntPoint& contentsPoint)
1309 { 1310 {
1310 if (isNone()) 1311 if (isNone())
1311 return; 1312 return;
1312 1313
1313 VisibleSelection newSelection = granularityStrategy()->updateExtent(contents Point, m_frame); 1314 VisibleSelection newSelection = granularityStrategy()->updateExtent(contents Point, m_frame);
1314 setSelection( 1315 setSelection(
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1380 1381
1381 void showTree(const blink::FrameSelection* sel) 1382 void showTree(const blink::FrameSelection* sel)
1382 { 1383 {
1383 if (sel) 1384 if (sel)
1384 sel->showTreeForThis(); 1385 sel->showTreeForThis();
1385 else 1386 else
1386 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); 1387 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n");
1387 } 1388 }
1388 1389
1389 #endif 1390 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.h ('k') | third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698