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

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

Issue 1927983002: 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@2704
Patch Set: Changed base::WrapUnique() to make_scoped_ptr(). 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 "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "ui/events/event_constants.h" 10 #include "ui/events/event_constants.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 // See description above field. 68 // See description above field.
69 void set_animate_on_state_change(bool value) { 69 void set_animate_on_state_change(bool value) {
70 animate_on_state_change_ = value; 70 animate_on_state_change_ = value;
71 } 71 }
72 72
73 // Sets the event on which the button should notify its listener. 73 // Sets the event on which the button should notify its listener.
74 void set_notify_action(NotifyAction notify_action) { 74 void set_notify_action(NotifyAction notify_action) {
75 notify_action_ = notify_action; 75 notify_action_ = notify_action;
76 } 76 }
77 77
78 void set_hide_ink_drop_when_showing_context_menu(
79 bool hide_ink_drop_when_showing_context_menu) {
80 hide_ink_drop_when_showing_context_menu_ =
81 hide_ink_drop_when_showing_context_menu;
82 }
83
78 void set_ink_drop_base_color(SkColor color) { ink_drop_base_color_ = color; } 84 void set_ink_drop_base_color(SkColor color) { ink_drop_base_color_ = color; }
79 85
80 void SetHotTracked(bool is_hot_tracked); 86 void SetHotTracked(bool is_hot_tracked);
81 bool IsHotTracked() const; 87 bool IsHotTracked() const;
82 88
83 // Overridden from View: 89 // Overridden from View:
84 void OnEnabledChanged() override; 90 void OnEnabledChanged() override;
85 const char* GetClassName() const override; 91 const char* GetClassName() const override;
86 bool OnMousePressed(const ui::MouseEvent& event) override; 92 bool OnMousePressed(const ui::MouseEvent& event) override;
87 bool OnMouseDragged(const ui::MouseEvent& event) override; 93 bool OnMouseDragged(const ui::MouseEvent& event) override;
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 195
190 // True when a button click should trigger an animation action on 196 // True when a button click should trigger an animation action on
191 // |ink_drop_delegate_|. 197 // |ink_drop_delegate_|.
192 // TODO(bruthig): Use an InkDropAction enum and drop the flag. 198 // TODO(bruthig): Use an InkDropAction enum and drop the flag.
193 bool has_ink_drop_action_on_click_; 199 bool has_ink_drop_action_on_click_;
194 200
195 // The animation action to trigger on the |ink_drop_delegate_| when the button 201 // The animation action to trigger on the |ink_drop_delegate_| when the button
196 // is clicked. 202 // is clicked.
197 InkDropState ink_drop_action_on_click_; 203 InkDropState ink_drop_action_on_click_;
198 204
205 // When true, the ink drop ripple and hover will be hidden prior to showing
206 // the context menu.
207 bool hide_ink_drop_when_showing_context_menu_;
208
199 // The color of the ripple and hover. 209 // The color of the ripple and hover.
200 SkColor ink_drop_base_color_; 210 SkColor ink_drop_base_color_;
201 211
202 // The MD-style focus ring. This is not done via a FocusPainter 212 // The MD-style focus ring. This is not done via a FocusPainter
203 // because it needs to paint to a layer so it can extend beyond the bounds of 213 // because it needs to paint to a layer so it can extend beyond the bounds of
204 // |this|. 214 // |this|.
205 views::View* md_focus_ring_; 215 views::View* md_focus_ring_;
206 216
207 DISALLOW_COPY_AND_ASSIGN(CustomButton); 217 DISALLOW_COPY_AND_ASSIGN(CustomButton);
208 }; 218 };
209 219
210 } // namespace views 220 } // namespace views
211 221
212 #endif // UI_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ 222 #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