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

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

Issue 2798143003: Avoid duplicate functions/code in core/editing: DirectionalSelection (Closed)
Patch Set: Created 3 years, 8 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 | « third_party/WebKit/Source/core/editing/SelectionModifier.h ('k') | no next file » | 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, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 23 matching lines...) Expand all
34 #include "core/layout/LayoutBlock.h" 34 #include "core/layout/LayoutBlock.h"
35 #include "core/layout/line/InlineTextBox.h" 35 #include "core/layout/line/InlineTextBox.h"
36 #include "core/page/SpatialNavigation.h" 36 #include "core/page/SpatialNavigation.h"
37 37
38 namespace blink { 38 namespace blink {
39 39
40 LayoutUnit NoXPosForVerticalArrowNavigation() { 40 LayoutUnit NoXPosForVerticalArrowNavigation() {
41 return LayoutUnit::min(); 41 return LayoutUnit::min();
42 } 42 }
43 43
44 static inline bool shouldAlwaysUseDirectionalSelection(LocalFrame* frame) { 44 bool SelectionModifier::shouldAlwaysUseDirectionalSelection(LocalFrame* frame) {
45 return !frame || 45 return !frame ||
46 frame->editor().behavior().shouldConsiderSelectionAsDirectional(); 46 frame->editor().behavior().shouldConsiderSelectionAsDirectional();
47 } 47 }
48 48
49 SelectionModifier::SelectionModifier(const LocalFrame& frame, 49 SelectionModifier::SelectionModifier(const LocalFrame& frame,
50 const VisibleSelection& selection, 50 const VisibleSelection& selection,
51 LayoutUnit xPosForVerticalArrowNavigation) 51 LayoutUnit xPosForVerticalArrowNavigation)
52 : m_frame(const_cast<LocalFrame*>(&frame)), 52 : m_frame(const_cast<LocalFrame*>(&frame)),
53 m_selection(selection), 53 m_selection(selection),
54 m_xPosForVerticalArrowNavigation(xPosForVerticalArrowNavigation) {} 54 m_xPosForVerticalArrowNavigation(xPosForVerticalArrowNavigation) {}
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 x = lineDirectionPointForBlockDirectionNavigationOf(visiblePosition); 851 x = lineDirectionPointForBlockDirectionNavigationOf(visiblePosition);
852 m_xPosForVerticalArrowNavigation = x; 852 m_xPosForVerticalArrowNavigation = x;
853 } else { 853 } else {
854 x = m_xPosForVerticalArrowNavigation; 854 x = m_xPosForVerticalArrowNavigation;
855 } 855 }
856 856
857 return x; 857 return x;
858 } 858 }
859 859
860 } // namespace blink 860 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/SelectionModifier.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698