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

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

Issue 2494333002: Replace wrapUnique(new T(args)) by makeUnique<T>(args) in Blink (Closed)
Patch Set: Drop redundant WTF:: Created 4 years, 1 month 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 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after
1308 // set yet. 1308 // set yet.
1309 SelectionStrategy strategyType = SelectionStrategy::Character; 1309 SelectionStrategy strategyType = SelectionStrategy::Character;
1310 Settings* settings = m_frame ? m_frame->settings() : 0; 1310 Settings* settings = m_frame ? m_frame->settings() : 0;
1311 if (settings && settings->selectionStrategy() == SelectionStrategy::Direction) 1311 if (settings && settings->selectionStrategy() == SelectionStrategy::Direction)
1312 strategyType = SelectionStrategy::Direction; 1312 strategyType = SelectionStrategy::Direction;
1313 1313
1314 if (m_granularityStrategy && m_granularityStrategy->GetType() == strategyType) 1314 if (m_granularityStrategy && m_granularityStrategy->GetType() == strategyType)
1315 return m_granularityStrategy.get(); 1315 return m_granularityStrategy.get();
1316 1316
1317 if (strategyType == SelectionStrategy::Direction) 1317 if (strategyType == SelectionStrategy::Direction)
1318 m_granularityStrategy = wrapUnique(new DirectionGranularityStrategy()); 1318 m_granularityStrategy = makeUnique<DirectionGranularityStrategy>();
1319 else 1319 else
1320 m_granularityStrategy = wrapUnique(new CharacterGranularityStrategy()); 1320 m_granularityStrategy = makeUnique<CharacterGranularityStrategy>();
1321 return m_granularityStrategy.get(); 1321 return m_granularityStrategy.get();
1322 } 1322 }
1323 1323
1324 void FrameSelection::moveRangeSelectionExtent(const IntPoint& contentsPoint) { 1324 void FrameSelection::moveRangeSelectionExtent(const IntPoint& contentsPoint) {
1325 if (isNone()) 1325 if (isNone())
1326 return; 1326 return;
1327 1327
1328 VisibleSelection newSelection = 1328 VisibleSelection newSelection =
1329 granularityStrategy()->updateExtent(contentsPoint, m_frame); 1329 granularityStrategy()->updateExtent(contentsPoint, m_frame);
1330 setSelection(newSelection, 1330 setSelection(newSelection,
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
1397 } 1397 }
1398 1398
1399 void showTree(const blink::FrameSelection* sel) { 1399 void showTree(const blink::FrameSelection* sel) {
1400 if (sel) 1400 if (sel)
1401 sel->showTreeForThis(); 1401 sel->showTreeForThis();
1402 else 1402 else
1403 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; 1403 LOG(INFO) << "Cannot showTree for <null> FrameSelection.";
1404 } 1404 }
1405 1405
1406 #endif 1406 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/editing/iterators/SearchBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698