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

Issue 2767183002: Removed SelectionPopupController.invalidateActionMode() (Closed)

Created:
3 years, 9 months ago by amaralp
Modified:
3 years, 9 months ago
Reviewers:
Jinsuk Kim, boliu
CC:
agrieve+watch_chromium.org, chromium-reviews, darin-cc_chromium.org, jam
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Removed SelectionPopupController.invalidateActionMode() I believe invalidateActionMode() is not necessary. The only callsite for it is in showActionMode() and it is only called if isActionModeValid() is true. The callsites for showActionMode() are: 1) SelectionPopupController.restoreSelectionPopupsIfNecessary which only calls showActionMode() if isActionModeValid() is false. Since showActionMode() won't call invalidateActionMode() if isActionModeValid() is false this case can't result in a call. 2) ContentViewCore.showSelectActionMode() which in turn is only called in ContentViewCore.onRotationChanged(). In onRotationChanged(), showSelectActionMode() is called right after hidePopupsAndPreserveSelection() which makes isActionModeValid() false. Again this means that showActionMode() wont result result in invalidateActionMode() being called. 3) SelectionPopupController.onSelectionEvent() when the event is SELECTION_HANDLES_SHOWN. As far as I know SELECTION_HANDLES_SHOWN should result in a new action mode since it means we have a new selection. I can't think of a reason why we'd want to invalidate instead of destroying the old action mode creating a new one. Review-Url: https://codereview.chromium.org/2767183002 Cr-Commit-Position: refs/heads/master@{#458997} Committed: https://chromium.googlesource.com/chromium/src/+/31843a5be08800e6bdf2a1f7c07eef342ad1abc6

Patch Set 1 #

Patch Set 2 : destroy old action mode #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -27 lines) Patch
M content/public/android/java/src/org/chromium/content/browser/SelectionPopupController.java View 1 2 chunks +1 line, -27 lines 0 comments Download

Messages

Total messages: 23 (14 generated)
amaralp
PTAL
3 years, 9 months ago (2017-03-22 22:27:27 UTC) #10
Jinsuk Kim
lgtm
3 years, 9 months ago (2017-03-22 23:52:29 UTC) #13
boliu
lgtm nice. I was wondering what's the difference between show and invalidate when reviewing tima's ...
3 years, 9 months ago (2017-03-23 03:37:23 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2767183002/20001
3 years, 9 months ago (2017-03-23 03:39:29 UTC) #16
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://chromium.googlesource.com/chromium/src/+/31843a5be08800e6bdf2a1f7c07eef342ad1abc6
3 years, 9 months ago (2017-03-23 03:45:40 UTC) #19
amaralp
A revert of this CL (patchset #2 id:20001) has been created in https://codereview.chromium.org/2776883002/ by amaralp@chromium.org. ...
3 years, 9 months ago (2017-03-25 02:32:18 UTC) #20
boliu
On 2017/03/25 02:32:18, amaralp wrote: > A revert of this CL (patchset #2 id:20001) has ...
3 years, 9 months ago (2017-03-25 21:16:40 UTC) #21
amaralp
On 2017/03/25 at 21:16:40, boliu wrote: > On 2017/03/25 02:32:18, amaralp wrote: > > A ...
3 years, 9 months ago (2017-03-27 17:47:44 UTC) #22
Tima Vaisburd
3 years, 9 months ago (2017-03-27 18:23:13 UTC) #23
Message was sent while issue was closed.
On 2017/03/27 17:47:44, amaralp wrote:
> On 2017/03/25 at 21:16:40, boliu wrote:
> > On 2017/03/25 02:32:18, amaralp wrote:
> > > A revert of this CL (patchset #2 id:20001) has been created in
> > > https://codereview.chromium.org/2776883002/ by
mailto:amaralp@chromium.org.
> > > 
> > > The reason for reverting is: For non-floating menu we should invalidate
> instead
> > > of destroying and creating..
> > 
> > Can you write that as a comment somewhere in code?
> > 
> > And regardless, can some of these call sites be simplified? It's still the
> case that only a single call site needs invalidate, right?
> 
> I think things can still be simplified. I'll upload a new CL.

I will be happy to synchronize http://crrev.com/2740103006 with this work.
I think selectAll() would need to either invalidate() or finish and restart as
well.

Powered by Google App Engine
This is Rietveld 408576698