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

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

Issue 328243004: Change a FrameSelection::setSelectedRange argument type from bool to enum. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « Source/core/editing/FrameSelection.h ('k') | Source/core/editing/InputMethodController.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after
1400 1400
1401 if (selectStartTarget && !selectStartTarget->dispatchEvent(Event::createCanc elableBubble(EventTypeNames::selectstart))) 1401 if (selectStartTarget && !selectStartTarget->dispatchEvent(Event::createCanc elableBubble(EventTypeNames::selectstart)))
1402 return; 1402 return;
1403 1403
1404 VisibleSelection newSelection(VisibleSelection::selectionFromContentsOfNode( root.get())); 1404 VisibleSelection newSelection(VisibleSelection::selectionFromContentsOfNode( root.get()));
1405 setSelection(newSelection); 1405 setSelection(newSelection);
1406 selectFrameElementInParentIfFullySelected(); 1406 selectFrameElementInParentIfFullySelected();
1407 notifyRendererOfSelectionChange(UserTriggered); 1407 notifyRendererOfSelectionChange(UserTriggered);
1408 } 1408 }
1409 1409
1410 bool FrameSelection::setSelectedRange(Range* range, EAffinity affinity, bool isD irectional, SetSelectionOptions options) 1410 bool FrameSelection::setSelectedRange(Range* range, EAffinity affinity, Directoi nalOption directional, SetSelectionOptions options)
1411 { 1411 {
1412 if (!range || !range->startContainer() || !range->endContainer()) 1412 if (!range || !range->startContainer() || !range->endContainer())
1413 return false; 1413 return false;
1414 ASSERT(range->startContainer()->document() == range->endContainer()->documen t()); 1414 ASSERT(range->startContainer()->document() == range->endContainer()->documen t());
1415 1415
1416 // Non-collapsed ranges are not allowed to start at the end of a line that i s wrapped, 1416 // Non-collapsed ranges are not allowed to start at the end of a line that i s wrapped,
1417 // they start at the beginning of the next line instead 1417 // they start at the beginning of the next line instead
1418 m_logicalRange = nullptr; 1418 m_logicalRange = nullptr;
1419 stopObservingVisibleSelectionChangeIfNecessary(); 1419 stopObservingVisibleSelectionChangeIfNecessary();
1420 1420
1421 VisibleSelection newSelection(range, affinity, isDirectional); 1421 VisibleSelection newSelection(range, affinity, directional == Directional);
1422 setSelection(newSelection, options); 1422 setSelection(newSelection, options);
1423 1423
1424 m_logicalRange = range->cloneRange(); 1424 m_logicalRange = range->cloneRange();
1425 startObservingVisibleSelectionChange(); 1425 startObservingVisibleSelectionChange();
1426 1426
1427 return true; 1427 return true;
1428 } 1428 }
1429 1429
1430 PassRefPtrWillBeRawPtr<Range> FrameSelection::firstRange() const 1430 PassRefPtrWillBeRawPtr<Range> FrameSelection::firstRange() const
1431 { 1431 {
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
1886 sel.showTreeForThis(); 1886 sel.showTreeForThis();
1887 } 1887 }
1888 1888
1889 void showTree(const WebCore::FrameSelection* sel) 1889 void showTree(const WebCore::FrameSelection* sel)
1890 { 1890 {
1891 if (sel) 1891 if (sel)
1892 sel->showTreeForThis(); 1892 sel->showTreeForThis();
1893 } 1893 }
1894 1894
1895 #endif 1895 #endif
OLDNEW
« no previous file with comments | « Source/core/editing/FrameSelection.h ('k') | Source/core/editing/InputMethodController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698