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

Unified Diff: chrome/browser/ui/views/download/download_item_view_md.cc

Issue 2042073002: Centered flood fill style ink drop ripples on mouse/touch points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renamed LocatedEvent::AsLocatedIfLocatedEvent() as FromIfValid(). Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/download/download_item_view_md.cc
diff --git a/chrome/browser/ui/views/download/download_item_view_md.cc b/chrome/browser/ui/views/download/download_item_view_md.cc
index 6b944ff2ab3154dc4efe835872781c31c8312de0..cdba5866e86fa0749e8b3384ace452da5df9f9c5 100644
--- a/chrome/browser/ui/views/download/download_item_view_md.cc
+++ b/chrome/browser/ui/views/download/download_item_view_md.cc
@@ -161,7 +161,8 @@ class DownloadItemViewMd::DropDownButton : public BarControlButton {
// Promoted visibility to public.
void AnimateInkDrop(views::InkDropState state) {
- BarControlButton::AnimateInkDrop(state);
+ // TODO(bruthig): Plumb in the proper Event.
+ BarControlButton::AnimateInkDrop(state, nullptr /* event */);
}
private:
@@ -409,7 +410,7 @@ bool DownloadItemViewMd::OnMouseDragged(const ui::MouseEvent& event) {
if (!starting_drag_) {
starting_drag_ = true;
drag_start_point_ = event.location();
- AnimateInkDrop(views::InkDropState::HIDDEN);
+ AnimateInkDrop(views::InkDropState::HIDDEN, &event);
}
if (dragging_) {
if (download()->GetState() == DownloadItem::COMPLETE) {
@@ -449,6 +450,7 @@ bool DownloadItemViewMd::OnKeyPressed(const ui::KeyEvent& event) {
if (event.key_code() == ui::VKEY_SPACE ||
event.key_code() == ui::VKEY_RETURN) {
+ AnimateInkDrop(views::InkDropState::ACTION_TRIGGERED, nullptr /* &event */);
// OpenDownload may delete this, so don't add any code after this line.
OpenDownload();
return true;
@@ -492,7 +494,7 @@ void DownloadItemViewMd::AddInkDropLayer(ui::Layer* ink_drop_layer) {
std::unique_ptr<views::InkDropRipple> DownloadItemViewMd::CreateInkDropRipple()
const {
return base::WrapUnique(new views::FloodFillInkDropRipple(
- GetLocalBounds(), GetLocalBounds().CenterPoint(),
+ GetLocalBounds(), GetInkDropCenterBasedOnLastEvent(),
color_utils::DeriveDefaultIconColor(GetTextColor())));
}
@@ -755,7 +757,6 @@ void DownloadItemViewMd::OpenDownload() {
base::Time::Now() - creation_time_);
UpdateAccessibleName();
- AnimateInkDrop(views::InkDropState::ACTION_TRIGGERED);
// Calling download()->OpenDownload may delete this, so this must be
// the last thing we do.
@@ -855,7 +856,7 @@ void DownloadItemViewMd::HandlePressEvent(const ui::LocatedEvent& event,
if (!active_event)
return;
- AnimateInkDrop(views::InkDropState::ACTION_PENDING);
+ AnimateInkDrop(views::InkDropState::ACTION_PENDING, &event);
}
void DownloadItemViewMd::HandleClickEvent(const ui::LocatedEvent& event,
@@ -867,6 +868,8 @@ void DownloadItemViewMd::HandleClickEvent(const ui::LocatedEvent& event,
if (!active_event || IsShowingWarningDialog())
return;
+ AnimateInkDrop(views::InkDropState::ACTION_TRIGGERED, &event);
+
// OpenDownload may delete this, so don't add any code after this line.
OpenDownload();
}
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc ('k') | chrome/browser/ui/views/location_bar/bubble_icon_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698