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

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

Issue 1285233004: Get rid of a redundant argument DOWNSTREAM from VisiblePosition constructor call sites (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-19T12:36:19 Rebase Created 5 years, 4 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/Editor.cpp ('k') | Source/core/editing/VisiblePosition.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) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
5 * Copyright (C) 2015 Google Inc. All rights reserved. 5 * Copyright (C) 2015 Google Inc. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 LayoutPoint vPoint = view->rootFrameToContents(event.event().position()) ; 150 LayoutPoint vPoint = view->rootFrameToContents(event.event().position()) ;
151 if (!extendSelection && selection().contains(vPoint)) { 151 if (!extendSelection && selection().contains(vPoint)) {
152 m_mouseDownWasSingleClickInSelection = true; 152 m_mouseDownWasSingleClickInSelection = true;
153 return false; 153 return false;
154 } 154 }
155 } 155 }
156 156
157 PositionWithAffinity eventPos = innerNode->layoutObject()->positionForPoint( event.localPoint()); 157 PositionWithAffinity eventPos = innerNode->layoutObject()->positionForPoint( event.localPoint());
158 VisiblePosition visiblePos(Strategy::toPositionType(eventPos.position()), ev entPos.affinity()); 158 VisiblePosition visiblePos(Strategy::toPositionType(eventPos.position()), ev entPos.affinity());
159 if (visiblePos.isNull()) 159 if (visiblePos.isNull())
160 visiblePos = VisiblePosition(firstPositionInOrBeforeNode(innerNode), DOW NSTREAM); 160 visiblePos = VisiblePosition(firstPositionInOrBeforeNode(innerNode));
161 PositionType pos = Strategy::toPositionType(visiblePos.deepEquivalent()); 161 PositionType pos = Strategy::toPositionType(visiblePos.deepEquivalent());
162 162
163 VisibleSelection newSelection = selection().selection(); 163 VisibleSelection newSelection = selection().selection();
164 TextGranularity granularity = CharacterGranularity; 164 TextGranularity granularity = CharacterGranularity;
165 165
166 if (extendSelection && newSelection.isCaretOrRange()) { 166 if (extendSelection && newSelection.isCaretOrRange()) {
167 VisibleSelection selectionInUserSelectAll(expandSelectionToRespectUserSe lectAll(innerNode, VisibleSelection(VisiblePosition(pos)))); 167 VisibleSelection selectionInUserSelectAll(expandSelectionToRespectUserSe lectAll(innerNode, VisibleSelection(VisiblePosition(pos))));
168 if (selectionInUserSelectAll.isRange()) { 168 if (selectionInUserSelectAll.isRange()) {
169 if (Strategy::selectionStart(selectionInUserSelectAll).compareTo(Str ategy::selectionStart(newSelection)) < 0) 169 if (Strategy::selectionStart(selectionInUserSelectAll).compareTo(Str ategy::selectionStart(newSelection)) < 0)
170 pos = Strategy::selectionStart(selectionInUserSelectAll); 170 pos = Strategy::selectionStart(selectionInUserSelectAll);
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 else 649 else
650 m_selectionState = SelectionState::HaveNotStartedSelection; 650 m_selectionState = SelectionState::HaveNotStartedSelection;
651 } 651 }
652 652
653 FrameSelection& SelectionController::selection() const 653 FrameSelection& SelectionController::selection() const
654 { 654 {
655 return m_frame->selection(); 655 return m_frame->selection();
656 } 656 }
657 657
658 } // namespace blink 658 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/editing/Editor.cpp ('k') | Source/core/editing/VisiblePosition.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698