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

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

Issue 1942843002: Fixed material design ink drop location for the MD download shelf buttons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Added some missing includes. Created 4 years, 8 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 d48f87cad5f3b6dc7e556380a6d8fec99c16b027..4e07af9bcc0c07e03064d196973a6eb270eeac24 100644
--- a/chrome/browser/ui/views/download/download_item_view_md.cc
+++ b/chrome/browser/ui/views/download/download_item_view_md.cc
@@ -17,6 +17,7 @@
#include "base/location.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
+#include "base/memory/scoped_ptr.h"
#include "base/metrics/histogram.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -473,20 +474,19 @@ void DownloadItemViewMd::AddInkDropLayer(ui::Layer* ink_drop_layer) {
layer()->SetMasksToBounds(true);
}
-std::unique_ptr<views::InkDropAnimation>
-DownloadItemViewMd::CreateInkDropAnimation() const {
- return base::WrapUnique(new views::FloodFillInkDropAnimation(
- size(), ink_drop_delegate_.last_ink_drop_location(),
+scoped_ptr<views::InkDropAnimation> DownloadItemViewMd::CreateInkDropAnimation()
+ const {
+ return make_scoped_ptr(new views::FloodFillInkDropAnimation(
+ GetLocalBounds(), ink_drop_delegate_.last_ink_drop_location(),
color_utils::DeriveDefaultIconColor(GetTextColor())));
}
-std::unique_ptr<views::InkDropHover> DownloadItemViewMd::CreateInkDropHover()
- const {
+scoped_ptr<views::InkDropHover> DownloadItemViewMd::CreateInkDropHover() const {
if (IsShowingWarningDialog())
return nullptr;
gfx::Size size = GetPreferredSize();
- return base::WrapUnique(new views::InkDropHover(
+ return make_scoped_ptr(new views::InkDropHover(
size, kInkDropSmallCornerRadius, gfx::Rect(size).CenterPoint(),
color_utils::DeriveDefaultIconColor(GetTextColor())));
}
@@ -835,6 +835,10 @@ void DownloadItemViewMd::HandlePressEvent(const ui::LocatedEvent& event,
if (complete_animation_.get() && complete_animation_->is_animating())
complete_animation_->End();
+ // Don't show the ripple for right clicks.
+ if (!active_event)
+ return;
+
ink_drop_delegate_.set_last_ink_drop_location(event.location());
ink_drop_delegate_.OnAction(views::InkDropState::ACTION_PENDING);
}
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc ('k') | ui/views/animation/flood_fill_ink_drop_animation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698