commit | 5b7d844c1da97a4cc68ab6809ec1a377b9b1e5a8 | [log] [tgz] |
---|---|---|
author | Luciano Pacheco <lucmult@chromium.org> | Mon May 13 06:09:09 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Mon May 13 06:09:09 2019 |
tree | 0785b656bac91f0b468b4ba2fb515d8120c723d2 | |
parent | 50a00e30bbe30a139aefeabb7ef57ad254874612 [diff] |
[Reland #2] Change ActionsController to only update DOM when displaying a menu Previously ActionsController would calculate the additional actions for Drive (share, create-shortcut, etc) and FSP [1] like change directory, selection changed, and metadata updated. When these events arrive in FilesApp, they update the <command> and <cr-menu> DOM state. However, that can cause flickering in visible menus and also flakes in browser tests based on menus, since these events can happen while the menu is displayed for an entry or set of entries (selection) or affect entries other than those associated with the menu. This CL changes ActionsController to store state in an internal map, rather than in the DOM, and to only update the menu DOM state when a user-action shows the menu. Change CommandHandler to set the visibility for Drive actions/commands synchronously to avoid flickering the size of the menu - it still can flicker the disabled state and pinned check-mark, but these are softer to human eyes than the change in size. Change ToolbarController to update its refresh button disabled state. The button relied on FileManagerCommands to update the |refresh| state command, which was not correct because the refresh button always acts on the current directory, whereas the command was being evaluated for different entries. Change Action models and derived classes to have a |getEntries| method so that ActionsController can get the entries that it is acting upon to invalidate the state prior to executation. Change ActionsSubMenu.setActionsModel to forward the target element, so the <command> can be updated to the correct target element. Change PluginVM test to use keyaboard shortcut instead of refresh button, because it was failing to refresh speculatively due to the button been disabled when clicked. [1] https://developer.chrome.com/apps/fileSystemProvider#event-onGetActionsRequested Change-Id: I33f322689d083b307e55ec9f045ee253bcde2c60 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1608962 Commit-Queue: Noel Gordon <noel@chromium.org> Auto-Submit: Luciano Pacheco <lucmult@chromium.org> Reviewed-by: Noel Gordon <noel@chromium.org> Cr-Commit-Position: refs/heads/master@{#658967}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .