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

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

Issue 2151933003: Change WTF::TemporaryChange to be an alias for AutoReset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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) 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 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 return; 601 return;
602 if (selection().contains(position) 602 if (selection().contains(position)
603 || mev.scrollbar() 603 || mev.scrollbar()
604 // FIXME: In the editable case, word selection sometimes selects content that isn't underneath the mouse. 604 // FIXME: In the editable case, word selection sometimes selects content that isn't underneath the mouse.
605 // If the selection is non-editable, we do word selection to make it eas ier to use the contextual menu items 605 // If the selection is non-editable, we do word selection to make it eas ier to use the contextual menu items
606 // available for text selections. But only if we're above text. 606 // available for text selections. But only if we're above text.
607 || !(selection().isContentEditable() || (mev.innerNode() && mev.innerNod e()->isTextNode()))) 607 || !(selection().isContentEditable() || (mev.innerNode() && mev.innerNod e()->isTextNode())))
608 return; 608 return;
609 609
610 // Context menu events are always allowed to perform a selection. 610 // Context menu events are always allowed to perform a selection.
611 TemporaryChange<bool> mouseDownMayStartSelectChange(m_mouseDownMayStartSelec t, true); 611 TemporaryChange<bool> mouseDownMayStartSelectChange(&m_mouseDownMayStartSele ct, true);
612 612
613 if (mev.hitTestResult().isMisspelled()) 613 if (mev.hitTestResult().isMisspelled())
614 return selectClosestMisspellingFromMouseEvent(mev); 614 return selectClosestMisspellingFromMouseEvent(mev);
615 615
616 if (!m_frame->editor().behavior().shouldSelectOnContextualMenuClick()) 616 if (!m_frame->editor().behavior().shouldSelectOnContextualMenuClick())
617 return; 617 return;
618 618
619 selectClosestWordOrLinkFromMouseEvent(mev); 619 selectClosestWordOrLinkFromMouseEvent(mev);
620 } 620 }
621 621
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 return event.event().altKey() && event.isOverLink(); 674 return event.event().altKey() && event.isOverLink();
675 } 675 }
676 676
677 bool isExtendingSelection(const MouseEventWithHitTestResults& event) 677 bool isExtendingSelection(const MouseEventWithHitTestResults& event)
678 { 678 {
679 bool isMouseDownOnLinkOrImage = event.isOverLink() || event.hitTestResult(). image(); 679 bool isMouseDownOnLinkOrImage = event.isOverLink() || event.hitTestResult(). image();
680 return event.event().shiftKey() && !isMouseDownOnLinkOrImage; 680 return event.event().shiftKey() && !isMouseDownOnLinkOrImage;
681 } 681 }
682 682
683 } // namespace blink 683 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698