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

Unified Diff: chrome/browser/ui/views/location_bar/bubble_icon_view.h

Issue 1518543002: Adds MD ink ripple animations to buttons within location bar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adds MD ink ripple animations to buttons within location bar (split gesture support into a separate… Created 5 years 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/bubble_icon_view.h
diff --git a/chrome/browser/ui/views/location_bar/bubble_icon_view.h b/chrome/browser/ui/views/location_bar/bubble_icon_view.h
index 47b9f80b49aa42a6838dde857929df9b2683432f..abe13add1339d4e174e7518e1bdaac3df8a4a0cd 100644
--- a/chrome/browser/ui/views/location_bar/bubble_icon_view.h
+++ b/chrome/browser/ui/views/location_bar/bubble_icon_view.h
@@ -5,8 +5,10 @@
#ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_BUBBLE_ICON_VIEW_H_
#define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_BUBBLE_ICON_VIEW_H_
+#include "base/memory/scoped_ptr.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/vector_icons_public.h"
+#include "ui/views/animation/ink_drop_host.h"
#include "ui/views/controls/image_view.h"
class CommandUpdater;
@@ -17,10 +19,12 @@ enum class VectorIconId;
namespace views {
class BubbleDelegateView;
+class InkDropDelegate;
}
// Represents an icon on the omnibox that shows a bubble when clicked.
-class BubbleIconView : public views::ImageView {
+class BubbleIconView : public views::ImageView,
+ public views::InkDropHost {
protected:
enum ExecuteSource {
EXECUTE_SOURCE_MOUSE,
@@ -41,9 +45,11 @@ class BubbleIconView : public views::ImageView {
void GetAccessibleState(ui::AXViewState* state) override;
bool GetTooltipText(const gfx::Point& p, base::string16* tooltip) const
override;
+ void Layout() override;
bool OnMousePressed(const ui::MouseEvent& event) override;
void OnMouseReleased(const ui::MouseEvent& event) override;
bool OnKeyPressed(const ui::KeyEvent& event) override;
+ void OnBubbleClosing() override;
void ViewHierarchyChanged(
const ViewHierarchyChangedDetails& details) override;
void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
@@ -51,6 +57,10 @@ class BubbleIconView : public views::ImageView {
// ui::EventHandler:
void OnGestureEvent(ui::GestureEvent* event) override;
+ // views::InkDropHost:
+ void AddInkDropLayer(ui::Layer* ink_drop_layer) override;
+ void RemoveInkDropLayer(ui::Layer* ink_drop_layer) override;
+
protected:
// Calls OnExecuting and runs |command_id_| with a valid |command_updater_|.
virtual void ExecuteCommand(ExecuteSource source);
@@ -70,6 +80,9 @@ class BubbleIconView : public views::ImageView {
// views::View:
void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
+ // views::InkDropHost:
+ gfx::Point CalculateInkDropCenter() const override;
+
// Updates the icon after some state has changed.
void UpdateIcon();
@@ -96,6 +109,9 @@ class BubbleIconView : public views::ImageView {
// prevent the bubble from reshowing.
bool suppress_mouse_released_action_;
+ // Animation delegate for the ink drop ripple effect.
+ scoped_ptr<views::InkDropDelegate> ink_drop_delegate_;
+
DISALLOW_COPY_AND_ASSIGN(BubbleIconView);
};

Powered by Google App Engine
This is Rietveld 408576698