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

Issue 2652833002: Remove infinite spin, make tooltip delay consistent (Closed)

Created:
3 years, 11 months ago by chengx
Modified:
3 years, 11 months ago
Reviewers:
sky
CC:
chromium-reviews, kalyank, sadrul, tfarina, brucedawson
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove infinite spin, make tooltip delay consistent The main motivation for the change is to reduce idle wakeups and therefore reduce idle power. Another motivation is to make the UI better, as currently tooltip shows up with random delay time. ToolTipController has a repeating timer firing 4 times per second that tries to update itself periodically, while most of the time there is no change at all. This CL removes this spin but keeps the same functionality by 1) upgrading OnMouseEvent() in TooltipController; 2) overriding OnWindowPropertyChanged() in TooltipController; 3) overriding OnCursorVisibilityChanged() in TooltipController. After the change, tooltip is updated on demand via observer pattern, rather than unnecessary periodic checking. On UI side, current production version hides tooltip immediately, but shows it up with a delay of a random few hundreds of ms. This is because of the RepeatingTimer implementation. One one hand, the delayed appearance of tooltip is preferred. On the other hand, the random delay time from instant to a few hundreds of ms doesn't look good. We improve this by introducing a timer to delay the tooltip's appearance by 500 ms. This makes the intended delay consistent for all tooltips. BUG=668198, 684877 Review-Url: https://codereview.chromium.org/2615993002 Cr-Commit-Position: refs/heads/master@{#443584} Committed: https://chromium.googlesource.com/chromium/src/+/6b8312a4903fc6965a64a3835524f1a8f384f26b patch from issue 2615993002 at patchset 520001 (http://crrev.com/2615993002#ps520001) Review-Url: https://codereview.chromium.org/2652833002 Cr-Commit-Position: refs/heads/master@{#445902} Committed: https://chromium.googlesource.com/chromium/src/+/122326d5ae2407e11a8b7353fd60dcffba5066fa

Patch Set 1 #

Patch Set 2 : Delay tooltip show up by 500ms to make it consistent with production version. #

Total comments: 6

Patch Set 3 : Fix nits. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+115 lines, -137 lines) Patch
M ash/tooltips/tooltip_controller_unittest.cc View 3 chunks +8 lines, -9 lines 0 comments Download
M ui/views/corewm/tooltip_controller.h View 1 2 6 chunks +25 lines, -5 lines 0 comments Download
M ui/views/corewm/tooltip_controller.cc View 1 2 10 chunks +55 lines, -54 lines 0 comments Download
M ui/views/corewm/tooltip_controller_test_helper.h View 1 chunk +1 line, -2 lines 0 comments Download
M ui/views/corewm/tooltip_controller_test_helper.cc View 1 2 chunks +3 lines, -6 lines 0 comments Download
M ui/views/corewm/tooltip_controller_unittest.cc View 25 chunks +13 lines, -54 lines 0 comments Download
M ui/wm/public/tooltip_client.h View 2 chunks +5 lines, -0 lines 0 comments Download
M ui/wm/public/tooltip_client.cc View 1 chunk +5 lines, -7 lines 0 comments Download

Messages

Total messages: 55 (49 generated)
chengx
Hi sky@, PTAL~ The 1st patch in this CL is the same one I checked ...
3 years, 11 months ago (2017-01-24 19:49:16 UTC) #36
sky
LGTM https://codereview.chromium.org/2652833002/diff/120001/ui/views/corewm/tooltip_controller.cc File ui/views/corewm/tooltip_controller.cc (right): https://codereview.chromium.org/2652833002/diff/120001/ui/views/corewm/tooltip_controller.cc#newcode323 ui/views/corewm/tooltip_controller.cc:323: } else Add {} https://codereview.chromium.org/2652833002/diff/120001/ui/views/corewm/tooltip_controller.cc#newcode329 ui/views/corewm/tooltip_controller.cc:329: if (!tooltip_window_) ...
3 years, 11 months ago (2017-01-24 22:13:39 UTC) #37
chengx
Nits addressed. Thanks, sky@ https://codereview.chromium.org/2652833002/diff/120001/ui/views/corewm/tooltip_controller.cc File ui/views/corewm/tooltip_controller.cc (right): https://codereview.chromium.org/2652833002/diff/120001/ui/views/corewm/tooltip_controller.cc#newcode323 ui/views/corewm/tooltip_controller.cc:323: } else On 2017/01/24 22:13:39, ...
3 years, 11 months ago (2017-01-25 01:25:53 UTC) #50
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/2652833002/140001
3 years, 11 months ago (2017-01-25 01:26:00 UTC) #51
commit-bot: I haz the power
Committed patchset #3 (id:140001) as https://chromium.googlesource.com/chromium/src/+/122326d5ae2407e11a8b7353fd60dcffba5066fa
3 years, 11 months ago (2017-01-25 01:34:48 UTC) #54
chengx
3 years, 11 months ago (2017-01-26 19:10:31 UTC) #55
Message was sent while issue was closed.
A revert of this CL (patchset #3 id:140001) has been created in
https://codereview.chromium.org/2654343003/ by chengx@chromium.org.

The reason for reverting is: Caused the UI regression 685078 and 685408
(duplicate).

Powered by Google App Engine
This is Rietveld 408576698