Commit 7c2b8cc3 authored by Allen Bauer's avatar Allen Bauer Committed by Commit Bot

Removed use of ButtonListener in favor of ButtonPressed callback.

Bug: 772945
Change-Id: Ib68c761d567456094a33ba075a639e932106a103
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2464346
Commit-Queue: Allen Bauer <kylixrd@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#816238}
parent 8c745ac7
......@@ -129,7 +129,8 @@ class ExpandArrowHighlightPathGenerator : public views::HighlightPathGenerator {
ExpandArrowView::ExpandArrowView(ContentsView* contents_view,
AppListView* app_list_view)
: views::Button(this),
: views::Button(base::BindRepeating(&ExpandArrowView::OnButtonPressed,
base::Unretained(this))),
contents_view_(contents_view),
app_list_view_(app_list_view) {
SetFocusBehavior(FocusBehavior::ALWAYS);
......@@ -244,14 +245,6 @@ void ExpandArrowView::PaintButtonContents(gfx::Canvas* canvas) {
canvas->DrawPath(arrow_path, arrow_flags);
}
void ExpandArrowView::ButtonPressed(views::Button* /*sender*/,
const ui::Event& /*event*/) {
button_pressed_ = true;
ResetHintingAnimation();
TransitToFullscreenAllAppsState();
GetInkDrop()->AnimateToState(views::InkDropState::ACTION_TRIGGERED);
}
gfx::Size ExpandArrowView::CalculatePreferredSize() const {
return gfx::Size(kTileWidth,
AppListConfig::instance().expand_arrow_tile_height());
......@@ -373,6 +366,13 @@ void ExpandArrowView::AnimationEnded(const gfx::Animation* /*animation*/) {
ScheduleHintingAnimation(false);
}
void ExpandArrowView::OnButtonPressed() {
button_pressed_ = true;
ResetHintingAnimation();
TransitToFullscreenAllAppsState();
GetInkDrop()->AnimateToState(views::InkDropState::ACTION_TRIGGERED);
}
void ExpandArrowView::TransitToFullscreenAllAppsState() {
UMA_HISTOGRAM_ENUMERATION(kPageOpenedHistogram, AppListState::kStateApps,
AppListState::kStateLast);
......
......@@ -29,7 +29,6 @@ class ContentsView;
// A tile item for the expand arrow on the start page.
class APP_LIST_EXPORT ExpandArrowView : public views::Button,
public views::ButtonListener,
public views::ViewTargeterDelegate {
public:
ExpandArrowView(ContentsView* contents_view, AppListView* app_list_view);
......@@ -38,9 +37,6 @@ class APP_LIST_EXPORT ExpandArrowView : public views::Button,
// views::Button:
void PaintButtonContents(gfx::Canvas* canvas) override;
// views::ButtonListener:
void ButtonPressed(views::Button* sender, const ui::Event& event) override;
// views::View:
gfx::Size CalculatePreferredSize() const override;
bool OnKeyPressed(const ui::KeyEvent& event) override;
......@@ -68,6 +64,8 @@ class APP_LIST_EXPORT ExpandArrowView : public views::Button,
void AnimationProgressed(const gfx::Animation* animation) override;
void AnimationEnded(const gfx::Animation* animation) override;
void OnButtonPressed();
void TransitToFullscreenAllAppsState();
// Schedule a hinting animation. |is_first_time| indicates whether the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment