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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2847663002: Don't show touch handles when selection hidden (Closed)
Patch Set: Created 3 years, 7 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/LayoutSelection.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) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 2045 matching lines...) Expand 10 before | Expand all | Expand 10 after
2056 } 2056 }
2057 } 2057 }
2058 2058
2059 bool FrameView::ComputeCompositedSelection(LocalFrame& frame, 2059 bool FrameView::ComputeCompositedSelection(LocalFrame& frame,
2060 CompositedSelection& selection) { 2060 CompositedSelection& selection) {
2061 if (!frame.View() || frame.View()->ShouldThrottleRendering()) 2061 if (!frame.View() || frame.View()->ShouldThrottleRendering())
2062 return false; 2062 return false;
2063 2063
2064 const VisibleSelection& visible_selection = 2064 const VisibleSelection& visible_selection =
2065 frame.Selection().ComputeVisibleSelectionInDOMTree(); 2065 frame.Selection().ComputeVisibleSelectionInDOMTree();
2066 if (visible_selection.IsNone() || !frame.Selection().IsHandleVisible()) 2066 if (visible_selection.IsNone() || !frame.Selection().IsHandleVisible() ||
2067 frame.Selection().LayoutSelectionForceHide())
hugoh_UTC2 2017/04/27 08:53:50 Thanks a lot! I am rewriting the "hide selection"
yosin_UTC9 2017/04/27 09:55:11 Yes, let's use |FrameSelection::HasFocus()| hugoh@
hugoh_UTC2 2017/05/15 15:33:58 FrameSelection::SelectionHasFocus() and FrameSelec
2067 return false; 2068 return false;
2068 2069
2069 // Non-editable caret selections lack any kind of UI affordance, and 2070 // Non-editable caret selections lack any kind of UI affordance, and
2070 // needn't be tracked by the client. 2071 // needn't be tracked by the client.
2071 if (visible_selection.IsCaret() && !visible_selection.IsContentEditable()) 2072 if (visible_selection.IsCaret() && !visible_selection.IsContentEditable())
2072 return false; 2073 return false;
2073 2074
2074 VisiblePosition visible_start(visible_selection.VisibleStart()); 2075 VisiblePosition visible_start(visible_selection.VisibleStart());
2075 RenderedPosition rendered_start(visible_start); 2076 RenderedPosition rendered_start(visible_start);
2076 rendered_start.PositionInGraphicsLayerBacking(selection.start, true); 2077 rendered_start.PositionInGraphicsLayerBacking(selection.start, true);
(...skipping 3297 matching lines...) Expand 10 before | Expand all | Expand 10 after
5374 void FrameView::SetAnimationHost( 5375 void FrameView::SetAnimationHost(
5375 std::unique_ptr<CompositorAnimationHost> host) { 5376 std::unique_ptr<CompositorAnimationHost> host) {
5376 animation_host_ = std::move(host); 5377 animation_host_ = std::move(host);
5377 } 5378 }
5378 5379
5379 LayoutUnit FrameView::CaretWidth() const { 5380 LayoutUnit FrameView::CaretWidth() const {
5380 return LayoutUnit(GetChromeClient()->WindowToViewportScalar(1)); 5381 return LayoutUnit(GetChromeClient()->WindowToViewportScalar(1));
5381 } 5382 }
5382 5383
5383 } // namespace blink 5384 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/LayoutSelection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698