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

Unified Diff: ui/views/animation/ink_drop_host_view.h

Issue 2001843002: Use ink drop hover for focus states on toolbar buttons and location (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: layout Created 4 years, 7 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
« no previous file with comments | « ui/views/animation/ink_drop_factory.cc ('k') | ui/views/animation/ink_drop_host_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/animation/ink_drop_host_view.h
diff --git a/ui/views/animation/ink_drop_host_view.h b/ui/views/animation/ink_drop_host_view.h
index e4ebe6d3b6d43256126325fccd46cdcef8a0dc12..f54b4f30b3ecd4dda4d61091511ac0fa91341ed6 100644
--- a/ui/views/animation/ink_drop_host_view.h
+++ b/ui/views/animation/ink_drop_host_view.h
@@ -9,6 +9,7 @@
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/geometry/size.h"
+#include "ui/views/animation/ink_drop_delegate.h"
#include "ui/views/animation/ink_drop_host.h"
#include "ui/views/view.h"
@@ -18,11 +19,8 @@ class InkDropRipple;
class InkDropHover;
// A view that provides InkDropHost functionality.
-class VIEWS_EXPORT InkDropHostView : public views::View, public InkDropHost {
+class VIEWS_EXPORT InkDropHostView : public View, public InkDropHost {
public:
- InkDropHostView();
- ~InkDropHostView() override;
-
// Overridden from views::InkDropHost:
void AddInkDropLayer(ui::Layer* ink_drop_layer) override;
void RemoveInkDropLayer(ui::Layer* ink_drop_layer) override;
@@ -31,16 +29,34 @@ class VIEWS_EXPORT InkDropHostView : public views::View, public InkDropHost {
void set_ink_drop_size(const gfx::Size& size) { ink_drop_size_ = size; }
+ InkDropDelegate* ink_drop_delegate() { return ink_drop_delegate_.get(); }
+
protected:
+ InkDropHostView();
+ ~InkDropHostView() override;
+
static const int kInkDropSmallCornerRadius;
+ // View
+ void OnFocus() override;
+ void OnBlur() override;
+
// Overrideable methods to allow views to provide minor tweaks to the default
// ink drop.
virtual gfx::Point GetInkDropCenter() const;
virtual SkColor GetInkDropBaseColor() const;
+ // Should return true if the ink drop is also used to depict focus.
+ virtual bool ShouldShowInkDropForFocus() const;
+
+ void set_ink_drop_delegate(std::unique_ptr<InkDropDelegate> delegate) {
+ ink_drop_delegate_ = std::move(delegate);
+ }
+
private:
+ std::unique_ptr<InkDropDelegate> ink_drop_delegate_;
gfx::Size ink_drop_size_;
+ bool destroying_;
DISALLOW_COPY_AND_ASSIGN(InkDropHostView);
};
« no previous file with comments | « ui/views/animation/ink_drop_factory.cc ('k') | ui/views/animation/ink_drop_host_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698