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}
1 file changed