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

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: Addressed review comments 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 enum InkDropType {
42 NO_INK_DROP,
43 INK_DROP_WITHOUT_GESTURE_HANDLING,
James Cook 2016/06/27 22:47:28 I like this much better. Can you add a brief comme
mohsen 2016/06/29 21:41:37 Done.
44 INK_DROP_WITH_GESTURE_HANDLING,
45 };
46
41 static const int kInkDropSmallCornerRadius; 47 static const int kInkDropSmallCornerRadius;
42 48
43 void set_ink_drop_visible_opacity(float visible_opacity) { 49 void set_ink_drop_visible_opacity(float visible_opacity) {
44 ink_drop_visible_opacity_ = visible_opacity; 50 ink_drop_visible_opacity_ = visible_opacity;
45 } 51 }
46 float ink_drop_visible_opacity() const { return ink_drop_visible_opacity_; } 52 float ink_drop_visible_opacity() const { return ink_drop_visible_opacity_; }
47 53
48 // Returns the default InkDropRipple centered on |center_point|. 54 // Returns the default InkDropRipple centered on |center_point|.
49 std::unique_ptr<InkDropRipple> CreateDefaultInkDropRipple( 55 std::unique_ptr<InkDropRipple> CreateDefaultInkDropRipple(
50 const gfx::Point& center_point) const; 56 const gfx::Point& center_point) const;
(...skipping 26 matching lines...) Expand all
77 virtual SkColor GetInkDropBaseColor() const; 83 virtual SkColor GetInkDropBaseColor() const;
78 84
79 // Should return true if the ink drop is also used to depict focus. 85 // Should return true if the ink drop is also used to depict focus.
80 virtual bool ShouldShowInkDropForFocus() const; 86 virtual bool ShouldShowInkDropForFocus() const;
81 87
82 InkDrop* ink_drop() { return ink_drop_.get(); } 88 InkDrop* ink_drop() { return ink_drop_.get(); }
83 89
84 // Toggle to enable/disable an InkDrop on this View. Descendants can override 90 // Toggle to enable/disable an InkDrop on this View. Descendants can override
85 // CreateInkDropHighlight() and CreateInkDropRipple() to change the look/feel 91 // CreateInkDropHighlight() and CreateInkDropRipple() to change the look/feel
86 // of the InkDrop. 92 // of the InkDrop.
87 void SetHasInkDrop(bool has_an_ink_drop); 93 void SetHasInkDrop(InkDropType ink_drop_type);
88 94
89 private: 95 private:
90 class InkDropGestureHandler; 96 class InkDropGestureHandler;
91 friend class InkDropGestureHandler; 97 friend class InkDropGestureHandler;
92 friend class test::InkDropHostViewTestApi; 98 friend class test::InkDropHostViewTestApi;
93 99
94 // The last user Event to trigger an ink drop ripple animation. 100 // The last user Event to trigger an ink drop ripple animation.
95 std::unique_ptr<ui::LocatedEvent> last_ripple_triggering_event_; 101 std::unique_ptr<ui::LocatedEvent> last_ripple_triggering_event_;
96 102
97 std::unique_ptr<InkDrop> ink_drop_; 103 std::unique_ptr<InkDrop> ink_drop_;
(...skipping 10 matching lines...) Expand all
108 // drop layer. 114 // drop layer.
109 bool old_paint_to_layer_; 115 bool old_paint_to_layer_;
110 116
111 bool destroying_; 117 bool destroying_;
112 118
113 DISALLOW_COPY_AND_ASSIGN(InkDropHostView); 119 DISALLOW_COPY_AND_ASSIGN(InkDropHostView);
114 }; 120 };
115 } // namespace views 121 } // namespace views
116 122
117 #endif // UI_VIEWS_ANIMATION_INK_DROP_HOST_VIEW_H_ 123 #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