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

Issue 2053113002: Replaced BackgroundAnimator with ShelfBackgroundAnimator. (Closed)

Created:
4 years, 6 months ago by bruthig
Modified:
4 years, 4 months ago
Reviewers:
James Cook, sky
CC:
chromium-reviews, kalyank, sadrul, yiyix
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Apply Shelf/Dock opacity animations for the Material Design style. The Shelf animates between the 3 ShelfBackgroundType's using 2 different animations; one uses BackgroundAnimator timers and View::OnPaint() and the other uses a Layer to animate the SHELF_BACKGROUND_MAXIMIZED opaque background. This change centralizes the animation logic so they all stay in sync and applies the opacity animations to the material design style Shelf/Dock. Eventually the ShelfBackgroundAnimator will be enhanced to animate between colors instead of just alpha values. Follow-up plans: - Use a single instance of the ShelfBackgroundAnimator. - Remove the |opaque_background_| from ShelfWidget and DockedBackgroundWidget. - Collapse the multiple BackgroundAnimators owned by the ShelfBackgroundAnimator into a single SlideAnimation. - Animate the MD AppList and Overflow buttons. BUG=607037 TEST=ShelfBackgroundAnimator(NonMD|MD)Test.* Committed: https://crrev.com/f34d76ca0084f12c0d01f18bd9549e300b8d2ada Cr-Commit-Position: refs/heads/master@{#408390}

Patch Set 1 #

Total comments: 9

Patch Set 2 : Working prototype snapshot. #

Patch Set 3 : Moved ash/test/material_design_controller_test_api.(h|cc) to ash/common/material_design/test/. #

Total comments: 69

Patch Set 4 : Rebase. #

Patch Set 5 : Rebase #

Patch Set 6 : Addressed comments from patch set 3. #

Patch Set 7 : Fixed tests. #

Patch Set 8 : Snapshot before merge with master. #

Patch Set 9 : Merge branch 'master' into animate_shelf_chip_backgrounds #

Patch Set 10 : Added some ShelfBackgroundAnimatorMDTests. #

Patch Set 11 : Added more tests, fixed bugs found, polish. #

Patch Set 12 : Merge branch 'master' into animate_shelf_chip_backgrounds #

Patch Set 13 : Added PaletteTray to the Shelf background animations. #

Total comments: 34

Patch Set 14 : Addressed easy comments from patch set 13. #

Patch Set 15 : Added WmShelf* param to ShelfBackgroundAnimator ctor. #

Patch Set 16 : Made the ShelfView add/remove itself as an observer from the ShelfBackgroundAnimator. #

Total comments: 4

Patch Set 17 : Addressed nits from patch set 16. #

Total comments: 2

Patch Set 18 : Removed TODO from animation_container.h. #

Patch Set 19 : Merge branch 'master' into animate_shelf_chip_backgrounds #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1064 lines, -310 lines) Patch
M ash/ash.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +6 lines, -2 lines 0 comments Download
M ash/aura/wm_shelf_aura.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +3 lines, -1 line 0 comments Download
M ash/common/material_design/material_design_controller_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M ash/common/shelf/app_list_button.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +6 lines, -0 lines 0 comments Download
M ash/common/shelf/app_list_button.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +11 lines, -11 lines 0 comments Download
M ash/common/shelf/overflow_button.h View 1 2 3 4 5 6 7 8 2 chunks +6 lines, -0 lines 0 comments Download
M ash/common/shelf/overflow_button.cc View 1 2 3 4 5 6 7 8 3 chunks +8 lines, -11 lines 0 comments Download
A ash/common/shelf/shelf_background_animator.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +134 lines, -0 lines 0 comments Download
A ash/common/shelf/shelf_background_animator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +202 lines, -0 lines 0 comments Download
A ash/common/shelf/shelf_background_animator_observer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +31 lines, -0 lines 0 comments Download
A ash/common/shelf/shelf_background_animator_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +411 lines, -0 lines 0 comments Download
M ash/common/shelf/wm_shelf_observer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -2 lines 0 comments Download
M ash/common/system/chromeos/power/power_status_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M ash/common/system/status_area_widget.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +6 lines, -1 line 0 comments Download
M ash/common/system/status_area_widget.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +12 lines, -0 lines 0 comments Download
M ash/common/system/tray/tray_background_view.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +6 lines, -6 lines 0 comments Download
M ash/common/system/tray/tray_background_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +13 lines, -18 lines 0 comments Download
A + ash/common/test/material_design_controller_test_api.h View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -3 lines 0 comments Download
A + ash/common/test/material_design_controller_test_api.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M ash/common/wm/background_animator.h View 1 2 3 4 5 3 chunks +9 lines, -1 line 0 comments Download
M ash/common/wm/background_animator.cc View 1 2 3 4 5 3 chunks +10 lines, -1 line 0 comments Download
M ash/common/wm/dock/docked_window_layout_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 6 chunks +27 lines, -35 lines 0 comments Download
M ash/root_window_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -1 line 0 comments Download
M ash/shelf/shelf.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +4 lines, -2 lines 0 comments Download
M ash/shelf/shelf.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +4 lines, -2 lines 0 comments Download
M ash/shelf/shelf_layout_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +3 lines, -3 lines 0 comments Download
M ash/shelf/shelf_layout_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +16 lines, -17 lines 0 comments Download
M ash/shelf/shelf_view.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 6 chunks +11 lines, -1 line 0 comments Download
M ash/shelf/shelf_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 7 chunks +16 lines, -3 lines 0 comments Download
M ash/shelf/shelf_view_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +1 line, -1 line 0 comments Download
M ash/shelf/shelf_widget.h View 1 2 3 4 5 6 7 8 9 10 4 chunks +5 lines, -3 lines 0 comments Download
M ash/shelf/shelf_widget.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 13 chunks +89 lines, -94 lines 0 comments Download
M ash/test/ash_md_test_base.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M ash/test/ash_md_test_base.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M ash/test/ash_test_helper.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
D ash/test/material_design_controller_test_api.h View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -38 lines 0 comments Download
D ash/test/material_design_controller_test_api.cc View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -46 lines 0 comments Download
M ash/wm/overview/window_selector_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +1 line, -1 line 0 comments Download

Messages

Total messages: 41 (23 generated)
bruthig
James, can you take a look from a design perspective before I invest too much ...
4 years, 6 months ago (2016-06-09 21:51:26 UTC) #2
James Cook
I'm OK with the overall approach. It's a bit of a bummer that there's another ...
4 years, 6 months ago (2016-06-09 23:40:37 UTC) #3
bruthig
James, Can you please take another look? https://codereview.chromium.org/2053113002/diff/1/ash/common/wm/background_animator.h File ash/common/wm/background_animator.h (right): https://codereview.chromium.org/2053113002/diff/1/ash/common/wm/background_animator.h#newcode28 ash/common/wm/background_animator.h:28: virtual void ...
4 years, 6 months ago (2016-06-14 16:40:44 UTC) #6
James Cook
Overall approach seems fine. https://codereview.chromium.org/2053113002/diff/40001/ash/ash.gyp File ash/ash.gyp (right): https://codereview.chromium.org/2053113002/diff/40001/ash/ash.gyp#newcode795 ash/ash.gyp:795: 'common/material_design/test/material_design_controller_test_api.cc', nit: Sort includes. Also, ...
4 years, 6 months ago (2016-06-14 17:50:02 UTC) #7
bruthig
James, can you PTAL? https://codereview.chromium.org/2053113002/diff/40001/ash/ash.gyp File ash/ash.gyp (right): https://codereview.chromium.org/2053113002/diff/40001/ash/ash.gyp#newcode795 ash/ash.gyp:795: 'common/material_design/test/material_design_controller_test_api.cc', On 2016/06/14 17:50:00, James ...
4 years, 4 months ago (2016-07-26 19:50:03 UTC) #10
James Cook
https://codereview.chromium.org/2053113002/diff/40001/ash/aura/wm_shelf_aura.cc File ash/aura/wm_shelf_aura.cc (right): https://codereview.chromium.org/2053113002/diff/40001/ash/aura/wm_shelf_aura.cc#newcode111 ash/aura/wm_shelf_aura.cc:111: if (background_type == GetBackgroundType()) On 2016/07/26 19:50:01, bruthig wrote: ...
4 years, 4 months ago (2016-07-27 00:30:39 UTC) #13
bruthig
James, can you take another look? I tried broke the changes down into 3 different ...
4 years, 4 months ago (2016-07-27 17:05:45 UTC) #15
James Cook
LGTM with nits. Hooray! https://codereview.chromium.org/2053113002/diff/300001/ash/common/shelf/shelf_background_animator_unittest.cc File ash/common/shelf/shelf_background_animator_unittest.cc (right): https://codereview.chromium.org/2053113002/diff/300001/ash/common/shelf/shelf_background_animator_unittest.cc#newcode69 ash/common/shelf/shelf_background_animator_unittest.cc:69: namespace test { nit: Remove. ...
4 years, 4 months ago (2016-07-27 17:33:10 UTC) #17
bruthig
sky@, can you take a quick look at the TODO I added in ui/gfx/animation/animation_container.h ? ...
4 years, 4 months ago (2016-07-27 18:01:47 UTC) #21
bruthig
https://codereview.chromium.org/2053113002/diff/300001/ash/common/shelf/shelf_background_animator_unittest.cc File ash/common/shelf/shelf_background_animator_unittest.cc (right): https://codereview.chromium.org/2053113002/diff/300001/ash/common/shelf/shelf_background_animator_unittest.cc#newcode69 ash/common/shelf/shelf_background_animator_unittest.cc:69: namespace test { On 2016/07/27 17:33:10, James Cook wrote: ...
4 years, 4 months ago (2016-07-27 18:09:00 UTC) #24
sky
https://codereview.chromium.org/2053113002/diff/320001/ui/gfx/animation/animation_container.h File ui/gfx/animation/animation_container.h (right): https://codereview.chromium.org/2053113002/diff/320001/ui/gfx/animation/animation_container.h#newcode30 ui/gfx/animation/animation_container.h:30: // TODO(bruthig): Enhance to use the same clock source ...
4 years, 4 months ago (2016-07-27 22:06:14 UTC) #27
bruthig
https://codereview.chromium.org/2053113002/diff/320001/ui/gfx/animation/animation_container.h File ui/gfx/animation/animation_container.h (right): https://codereview.chromium.org/2053113002/diff/320001/ui/gfx/animation/animation_container.h#newcode30 ui/gfx/animation/animation_container.h:30: // TODO(bruthig): Enhance to use the same clock source ...
4 years, 4 months ago (2016-07-28 13:42:03 UTC) #28
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/2053113002/340001
4 years, 4 months ago (2016-07-28 13:42:29 UTC) #31
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/42889) ios-device-gn on master.tryserver.chromium.mac (JOB_FAILED, ...
4 years, 4 months ago (2016-07-28 13:44:16 UTC) #33
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/2053113002/360001
4 years, 4 months ago (2016-07-28 14:02:17 UTC) #36
commit-bot: I haz the power
Committed patchset #19 (id:360001)
4 years, 4 months ago (2016-07-28 14:50:20 UTC) #38
commit-bot: I haz the power
Patchset 19 (id:??) landed as https://crrev.com/f34d76ca0084f12c0d01f18bd9549e300b8d2ada Cr-Commit-Position: refs/heads/master@{#408390}
4 years, 4 months ago (2016-07-28 14:52:37 UTC) #40
tapted
4 years, 4 months ago (2016-07-29 00:37:50 UTC) #41
Message was sent while issue was closed.
A revert of this CL (patchset #19 id:360001) has been created in
https://codereview.chromium.org/2191153002/ by tapted@chromium.org.

The reason for reverting is: Many ASAN failures in ash_unittests and others on
ChromeOS builders

link:
https://build.chromium.org/p/chromium.memory/builders/Linux%20Chromium%20OS%2...

errors like

==3029==ERROR: AddressSanitizer: heap-use-after-free on address 0x6030000b9800
at pc 0x0000127a38fa bp 0x7fff10ad4a50 sp 0x7fff10ad4a48
READ of size 8 at 0x6030000b9800 thread T0
    #0 0x127a38f9 in
__find<__gnu_cxx::__normal_iterator<ash::ShelfBackgroundAnimatorObserver **,
std::vector<ash::ShelfBackgroundAnimatorObserver *,
std::allocator<ash::ShelfBackgroundAnimatorObserver *> > >,
ash::ShelfBackgroundAnimatorObserver *>
../../include/c++/4.6/bits/stl_algo.h:190:8
    #1 0x127a38f9 in
find<__gnu_cxx::__normal_iterator<ash::ShelfBackgroundAnimatorObserver **,
std::vector<ash::ShelfBackgroundAnimatorObserver *,
std::allocator<ash::ShelfBackgroundAnimatorObserver *> > >,
ash::ShelfBackgroundAnimatorObserver *>
../../include/c++/4.6/bits/stl_algo.h:4402
    #2 0x127a38f9 in
base::ObserverListBase<ash::ShelfBackgroundAnimatorObserver>::RemoveObserver(ash::ShelfBackgroundAnimatorObserver*)
base/observer_list.h:174
    #3 0x127033f2 in ash::ShelfView::~ShelfView() ash/shelf/shelf_view.cc:408:27
    #4 0x12703a5d in ash::ShelfView::~ShelfView() ash/shelf/shelf_view.cc:404:25
    #5 0xcf2b9f1 in views::View::~View() ui/views/view.cc:134:7
    #6 0x127191a4 in ~DelegateView ash/shelf/shelf_widget.cc:407:44
    #7 0x127191a4 in non-virtual thunk to
ash::ShelfWidget::DelegateView::~DelegateView() ash/shelf/shelf_widget.cc:407
    #8 0xcf2dd8d in operator() ../../include/c++/4.6/bits/unique_ptr.h:63:2
    #9 0xcf2dd8d in reset ../../include/c++/4.6/bits/unique_ptr.h:245
    #10 0xcf2dd8d in ~unique_ptr ../../include/c++/4.6/bits/unique_ptr.h:169
    #11 0xcf2dd8d in views::View::DoRemoveChildView(views::View*, bool, bool,
bool, views::View*) ui/views/view.cc:1847
...
0x6030000b9800 is located 0 bytes inside of 32-byte region
[0x6030000b9800,0x6030000b9820)
freed by thread T0 here:
    #0 0xa83edb in operator delete(void*)
(/b/swarm_slave/w/ireuBjON/out/Release/unit_tests+0xa83edb)
    #1 0x127a2c17 in deallocate ../../include/c++/4.6/ext/new_allocator.h:98:9
    #2 0x127a2c17 in _M_deallocate ../../include/c++/4.6/bits/stl_vector.h:156
    #3 0x127a2c17 in ~_Vector_base ../../include/c++/4.6/bits/stl_vector.h:142
    #4 0x127a2c17 in ~vector ../../include/c++/4.6/bits/stl_vector.h:351
    #5 0x127a2c17 in ~ObserverListBase base/observer_list.h:69
    #6 0x127a2c17 in ~ObserverList base/observer_list.h:229
    #7 0x127a2c17 in ash::ShelfBackgroundAnimator::~ShelfBackgroundAnimator()
ash/common/shelf/shelf_background_animator.cc:37
.

Powered by Google App Engine
This is Rietveld 408576698