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

Unified Diff: chrome/browser/ui/views/location_bar/content_setting_image_view.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: Polished for review. 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/location_bar/content_setting_image_view.cc
diff --git a/chrome/browser/ui/views/location_bar/content_setting_image_view.cc b/chrome/browser/ui/views/location_bar/content_setting_image_view.cc
index 7c516e43694333163c811f02e8e3d03f4ad1e20a..69253801c0d721bc82399f580bcf4a87a5278ce2 100644
--- a/chrome/browser/ui/views/location_bar/content_setting_image_view.cc
+++ b/chrome/browser/ui/views/location_bar/content_setting_image_view.cc
@@ -92,7 +92,7 @@ void ContentSettingImageView::Update(content::WebContents* web_contents) {
// mechanism to show one after the other, but it doesn't seem important now.
int string_id = content_setting_image_model_->explanatory_string_id();
if (string_id && !label()->visible()) {
- AnimateInkDrop(views::InkDropState::HIDDEN);
+ AnimateInkDrop(views::InkDropState::HIDDEN, nullptr /* event */);
SetLabel(l10n_util::GetStringUTF16(string_id));
label()->SetVisible(true);
slide_animator_.Show();
@@ -115,7 +115,7 @@ bool ContentSettingImageView::OnMousePressed(const ui::MouseEvent& event) {
// If the bubble is showing then don't reshow it when the mouse is released.
suppress_mouse_released_action_ = bubble_view_ != nullptr;
if (!suppress_mouse_released_action_ && !label()->visible())
- AnimateInkDrop(views::InkDropState::ACTION_PENDING);
+ AnimateInkDrop(views::InkDropState::ACTION_PENDING, &event);
// We want to show the bubble on mouse release; that is the standard behavior
// for buttons.
@@ -132,14 +132,14 @@ void ContentSettingImageView::OnMouseReleased(const ui::MouseEvent& event) {
}
const bool activated = HitTestPoint(event.location());
if (!label()->visible() && !activated)
- AnimateInkDrop(views::InkDropState::HIDDEN);
+ AnimateInkDrop(views::InkDropState::HIDDEN, &event);
if (activated)
- OnActivate();
+ OnActivate(&event);
}
void ContentSettingImageView::OnGestureEvent(ui::GestureEvent* event) {
if (event->type() == ui::ET_GESTURE_TAP)
- OnActivate();
+ OnActivate(event);
if ((event->type() == ui::ET_GESTURE_TAP) ||
(event->type() == ui::ET_GESTURE_TAP_DOWN))
event->SetHandled();
@@ -191,7 +191,7 @@ bool ContentSettingImageView::IsShrinking() const {
slide_animator_.GetCurrentValue() > (1.0 - kOpenFraction));
}
-bool ContentSettingImageView::OnActivate() {
+bool ContentSettingImageView::OnActivate(const ui::Event* event) {
if (slide_animator_.is_animating()) {
// If the user clicks while we're animating, the bubble arrow will be
// pointing to the image, and if we allow the animation to keep running, the
@@ -226,7 +226,7 @@ bool ContentSettingImageView::OnActivate() {
// the animation simply pauses and no other visible state change occurs, so
// show the arrow in this case.
if (ui::MaterialDesignController::IsModeMaterial() && !pause_animation_) {
- AnimateInkDrop(views::InkDropState::ACTIVATED);
+ AnimateInkDrop(views::InkDropState::ACTIVATED, event);
bubble_view_->SetArrowPaintType(views::BubbleBorder::PAINT_TRANSPARENT);
}
bubble_widget->Show();
@@ -274,7 +274,7 @@ void ContentSettingImageView::OnWidgetVisibilityChanged(views::Widget* widget,
bool visible) {
// |widget| is a bubble that has just got shown / hidden.
if (!visible && !label()->visible())
- AnimateInkDrop(views::InkDropState::DEACTIVATED);
+ AnimateInkDrop(views::InkDropState::DEACTIVATED, nullptr /* event */);
}
void ContentSettingImageView::UpdateImage() {

Powered by Google App Engine
This is Rietveld 408576698