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

Side by Side Diff: ui/views/controls/button/custom_button.h

Issue 2447523002: [ash-md] Added different highlighting modes to the InkDropImpl. (Closed)
Patch Set: Fixed compile errors. Created 4 years, 1 month 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ 5 #ifndef UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_
6 #define UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ 6 #define UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 bool OnKeyPressed(const ui::KeyEvent& event) override; 102 bool OnKeyPressed(const ui::KeyEvent& event) override;
103 bool OnKeyReleased(const ui::KeyEvent& event) override; 103 bool OnKeyReleased(const ui::KeyEvent& event) override;
104 void OnGestureEvent(ui::GestureEvent* event) override; 104 void OnGestureEvent(ui::GestureEvent* event) override;
105 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; 105 bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
106 bool SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) override; 106 bool SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) override;
107 void ShowContextMenu(const gfx::Point& p, 107 void ShowContextMenu(const gfx::Point& p,
108 ui::MenuSourceType source_type) override; 108 ui::MenuSourceType source_type) override;
109 void OnDragDone() override; 109 void OnDragDone() override;
110 void GetAccessibleState(ui::AXViewState* state) override; 110 void GetAccessibleState(ui::AXViewState* state) override;
111 void VisibilityChanged(View* starting_from, bool is_visible) override; 111 void VisibilityChanged(View* starting_from, bool is_visible) override;
112 std::unique_ptr<InkDropHighlight> CreateInkDropHighlight() const override;
113 SkColor GetInkDropBaseColor() const override; 112 SkColor GetInkDropBaseColor() const override;
114 113
115 // Overridden from gfx::AnimationDelegate: 114 // Overridden from gfx::AnimationDelegate:
116 void AnimationProgressed(const gfx::Animation* animation) override; 115 void AnimationProgressed(const gfx::Animation* animation) override;
117 116
118 // Overridden from View: 117 // Overridden from View:
119 void ViewHierarchyChanged( 118 void ViewHierarchyChanged(
120 const ViewHierarchyChangedDetails& details) override; 119 const ViewHierarchyChangedDetails& details) override;
121 void OnBlur() override; 120 void OnBlur() override;
122 bool ShouldShowInkDropForFocus() const override; 121 bool ShouldShowInkDropForFocus() const override;
(...skipping 10 matching lines...) Expand all
133 132
134 // Returns true if the event is one that can trigger notifying the listener. 133 // Returns true if the event is one that can trigger notifying the listener.
135 // This implementation returns true if the left mouse button is down. 134 // This implementation returns true if the left mouse button is down.
136 virtual bool IsTriggerableEvent(const ui::Event& event); 135 virtual bool IsTriggerableEvent(const ui::Event& event);
137 136
138 // Returns true if the button should become pressed when the user 137 // Returns true if the button should become pressed when the user
139 // holds the mouse down over the button. For this implementation, 138 // holds the mouse down over the button. For this implementation,
140 // we simply return IsTriggerableEvent(event). 139 // we simply return IsTriggerableEvent(event).
141 virtual bool ShouldEnterPushedState(const ui::Event& event); 140 virtual bool ShouldEnterPushedState(const ui::Event& event);
142 141
143 // Returns true if highlight effect should be visible.
144 virtual bool ShouldShowInkDropHighlight() const;
145
146 void set_has_ink_drop_action_on_click(bool has_ink_drop_action_on_click) { 142 void set_has_ink_drop_action_on_click(bool has_ink_drop_action_on_click) {
147 has_ink_drop_action_on_click_ = has_ink_drop_action_on_click; 143 has_ink_drop_action_on_click_ = has_ink_drop_action_on_click;
148 } 144 }
149 145
150 // Returns true if the button should enter hovered state; that is, if the 146 // Returns true if the button should enter hovered state; that is, if the
151 // mouse is over the button, and no other window has capture (which would 147 // mouse is over the button, and no other window has capture (which would
152 // prevent the button from receiving MouseExited events and updating its 148 // prevent the button from receiving MouseExited events and updating its
153 // state). This does not take into account enabled state. 149 // state). This does not take into account enabled state.
154 bool ShouldEnterHoveredState(); 150 bool ShouldEnterHoveredState();
155 151
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 187
192 // The color of the ripple and hover. 188 // The color of the ripple and hover.
193 SkColor ink_drop_base_color_; 189 SkColor ink_drop_base_color_;
194 190
195 DISALLOW_COPY_AND_ASSIGN(CustomButton); 191 DISALLOW_COPY_AND_ASSIGN(CustomButton);
196 }; 192 };
197 193
198 } // namespace views 194 } // namespace views
199 195
200 #endif // UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ 196 #endif // UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698