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

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

Issue 1920783003: Fixed Back/Forward buttons to not hide ink drop when long press shows drop down menu. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // See description above field. 69 // See description above field.
70 void set_animate_on_state_change(bool value) { 70 void set_animate_on_state_change(bool value) {
71 animate_on_state_change_ = value; 71 animate_on_state_change_ = value;
72 } 72 }
73 73
74 // Sets the event on which the button should notify its listener. 74 // Sets the event on which the button should notify its listener.
75 void set_notify_action(NotifyAction notify_action) { 75 void set_notify_action(NotifyAction notify_action) {
76 notify_action_ = notify_action; 76 notify_action_ = notify_action;
77 } 77 }
78 78
79 void set_hide_ink_drop_when_showing_context_menu(
80 bool hide_ink_drop_when_showing_context_menu) {
81 hide_ink_drop_when_showing_context_menu_ =
82 hide_ink_drop_when_showing_context_menu;
83 }
84
79 void set_ink_drop_base_color(SkColor color) { ink_drop_base_color_ = color; } 85 void set_ink_drop_base_color(SkColor color) { ink_drop_base_color_ = color; }
80 86
81 void SetHotTracked(bool is_hot_tracked); 87 void SetHotTracked(bool is_hot_tracked);
82 bool IsHotTracked() const; 88 bool IsHotTracked() const;
83 89
84 // Overridden from View: 90 // Overridden from View:
85 void OnEnabledChanged() override; 91 void OnEnabledChanged() override;
86 const char* GetClassName() const override; 92 const char* GetClassName() const override;
87 bool OnMousePressed(const ui::MouseEvent& event) override; 93 bool OnMousePressed(const ui::MouseEvent& event) override;
88 bool OnMouseDragged(const ui::MouseEvent& event) override; 94 bool OnMouseDragged(const ui::MouseEvent& event) override;
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 196
191 // True when a button click should trigger an animation action on 197 // True when a button click should trigger an animation action on
192 // |ink_drop_delegate_|. 198 // |ink_drop_delegate_|.
193 // TODO(bruthig): Use an InkDropAction enum and drop the flag. 199 // TODO(bruthig): Use an InkDropAction enum and drop the flag.
194 bool has_ink_drop_action_on_click_; 200 bool has_ink_drop_action_on_click_;
195 201
196 // The animation action to trigger on the |ink_drop_delegate_| when the button 202 // The animation action to trigger on the |ink_drop_delegate_| when the button
197 // is clicked. 203 // is clicked.
198 InkDropState ink_drop_action_on_click_; 204 InkDropState ink_drop_action_on_click_;
199 205
206 // When true, the ink drop ripple and hover will be hidden prior to showing
207 // the context menu.
208 bool hide_ink_drop_when_showing_context_menu_;
209
200 // The color of the ripple and hover. 210 // The color of the ripple and hover.
201 SkColor ink_drop_base_color_; 211 SkColor ink_drop_base_color_;
202 212
203 // The MD-style focus ring. This is not done via a FocusPainter 213 // The MD-style focus ring. This is not done via a FocusPainter
204 // because it needs to paint to a layer so it can extend beyond the bounds of 214 // because it needs to paint to a layer so it can extend beyond the bounds of
205 // |this|. 215 // |this|.
206 views::View* md_focus_ring_; 216 views::View* md_focus_ring_;
207 217
208 DISALLOW_COPY_AND_ASSIGN(CustomButton); 218 DISALLOW_COPY_AND_ASSIGN(CustomButton);
209 }; 219 };
210 220
211 } // namespace views 221 } // namespace views
212 222
213 #endif // UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ 223 #endif // UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_view.cc ('k') | ui/views/controls/button/custom_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698