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

Side by Side Diff: ui/views/animation/ink_drop_host_view.h

Issue 2070143003: Add MD ink drop ripple to app list button (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@b612539_shelf_button_ripple
Patch Set: Rebased+ Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_VIEWS_ANIMATION_INK_DROP_HOST_VIEW_H_ 5 #ifndef UI_VIEWS_ANIMATION_INK_DROP_HOST_VIEW_H_
6 #define UI_VIEWS_ANIMATION_INK_DROP_HOST_VIEW_H_ 6 #define UI_VIEWS_ANIMATION_INK_DROP_HOST_VIEW_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "third_party/skia/include/core/SkColor.h" 10 #include "third_party/skia/include/core/SkColor.h"
(...skipping 20 matching lines...) Expand all
31 31
32 // Overridden from InkDropHost: 32 // Overridden from InkDropHost:
33 void AddInkDropLayer(ui::Layer* ink_drop_layer) override; 33 void AddInkDropLayer(ui::Layer* ink_drop_layer) override;
34 void RemoveInkDropLayer(ui::Layer* ink_drop_layer) override; 34 void RemoveInkDropLayer(ui::Layer* ink_drop_layer) override;
35 std::unique_ptr<InkDropRipple> CreateInkDropRipple() const override; 35 std::unique_ptr<InkDropRipple> CreateInkDropRipple() const override;
36 std::unique_ptr<InkDropHighlight> CreateInkDropHighlight() const override; 36 std::unique_ptr<InkDropHighlight> CreateInkDropHighlight() const override;
37 37
38 void set_ink_drop_size(const gfx::Size& size) { ink_drop_size_ = size; } 38 void set_ink_drop_size(const gfx::Size& size) { ink_drop_size_ = size; }
39 39
40 protected: 40 protected:
41 // Used in SetHasInkDrop() to specify whether the ink drop effect is enabled
42 // or not for the view. In case of having an ink drop, it also specifies
43 // whether the default gesture event handler for the ink drop should be
44 // installed or the subclass will handle gesture events itself.
45 enum InkDropType {
46 NO_INK_DROP,
47 INK_DROP_WITHOUT_GESTURE_HANDLING,
48 INK_DROP_WITH_GESTURE_HANDLING,
49 };
50
41 static const int kInkDropSmallCornerRadius; 51 static const int kInkDropSmallCornerRadius;
42 52
43 void set_ink_drop_visible_opacity(float visible_opacity) { 53 void set_ink_drop_visible_opacity(float visible_opacity) {
44 ink_drop_visible_opacity_ = visible_opacity; 54 ink_drop_visible_opacity_ = visible_opacity;
45 } 55 }
46 float ink_drop_visible_opacity() const { return ink_drop_visible_opacity_; } 56 float ink_drop_visible_opacity() const { return ink_drop_visible_opacity_; }
47 57
48 // Returns the default InkDropRipple centered on |center_point|. 58 // Returns the default InkDropRipple centered on |center_point|.
49 std::unique_ptr<InkDropRipple> CreateDefaultInkDropRipple( 59 std::unique_ptr<InkDropRipple> CreateDefaultInkDropRipple(
50 const gfx::Point& center_point) const; 60 const gfx::Point& center_point) const;
(...skipping 26 matching lines...) Expand all
77 virtual SkColor GetInkDropBaseColor() const; 87 virtual SkColor GetInkDropBaseColor() const;
78 88
79 // Should return true if the ink drop is also used to depict focus. 89 // Should return true if the ink drop is also used to depict focus.
80 virtual bool ShouldShowInkDropForFocus() const; 90 virtual bool ShouldShowInkDropForFocus() const;
81 91
82 InkDrop* ink_drop() { return ink_drop_.get(); } 92 InkDrop* ink_drop() { return ink_drop_.get(); }
83 93
84 // Toggle to enable/disable an InkDrop on this View. Descendants can override 94 // Toggle to enable/disable an InkDrop on this View. Descendants can override
85 // CreateInkDropHighlight() and CreateInkDropRipple() to change the look/feel 95 // CreateInkDropHighlight() and CreateInkDropRipple() to change the look/feel
86 // of the InkDrop. 96 // of the InkDrop.
87 void SetHasInkDrop(bool has_an_ink_drop); 97 void SetHasInkDrop(InkDropType ink_drop_type);
sky 2016/06/29 22:58:34 SetHasInkDrop makes sense when the type is boolean
mohsen 2016/06/30 00:03:45 Yeah, I had thought of SetInkDropType(), but that
88 98
89 private: 99 private:
90 class InkDropGestureHandler; 100 class InkDropGestureHandler;
91 friend class InkDropGestureHandler; 101 friend class InkDropGestureHandler;
92 friend class test::InkDropHostViewTestApi; 102 friend class test::InkDropHostViewTestApi;
93 103
94 // The last user Event to trigger an ink drop ripple animation. 104 // The last user Event to trigger an ink drop ripple animation.
95 std::unique_ptr<ui::LocatedEvent> last_ripple_triggering_event_; 105 std::unique_ptr<ui::LocatedEvent> last_ripple_triggering_event_;
96 106
97 std::unique_ptr<InkDrop> ink_drop_; 107 std::unique_ptr<InkDrop> ink_drop_;
(...skipping 10 matching lines...) Expand all
108 // drop layer. 118 // drop layer.
109 bool old_paint_to_layer_; 119 bool old_paint_to_layer_;
110 120
111 bool destroying_; 121 bool destroying_;
112 122
113 DISALLOW_COPY_AND_ASSIGN(InkDropHostView); 123 DISALLOW_COPY_AND_ASSIGN(InkDropHostView);
114 }; 124 };
115 } // namespace views 125 } // namespace views
116 126
117 #endif // UI_VIEWS_ANIMATION_INK_DROP_HOST_VIEW_H_ 127 #endif // UI_VIEWS_ANIMATION_INK_DROP_HOST_VIEW_H_
OLDNEW
« no previous file with comments | « ui/app_list/presenter/app_list_presenter_impl.h ('k') | ui/views/animation/ink_drop_host_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698