[go: nahoru, domu]

CrOS shelf: refactor some code between the various shelf button classes

Change the hierarchy a bit:

                ShelfButton
                 /      \
                /        \
      ShelfAppButton    ShelfControlButton
        (new class)         \
                       {AppList,Back,Overflow}Button

This allows us to gather some logic common to all shelf buttons into
the ShelfButton class and avoid a bit of duplication in all subclasses.

The ShelfAppButton class is very close to the former ShelfButton class.
The new ShelfButton class is a lot shorter.

Also remove the ink drop listener constructor argument, since there
were no occurrences where that listener was different from the shelf
view (so we only need the shelf view as a constructor argument).

Yay deletions!

Bug: 714781
Change-Id: I5d39e9f58a457513a475c1c499dee60baa8d8b5a
Reviewed-on: https://chromium-review.googlesource.com/c/1396319
Commit-Queue: Manu Cornet <manucornet@chromium.org>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#622346}
21 files changed