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

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

Issue 1390113006: Added material design mouse hover feedback support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed pkasting@'s comments from patch set 13. Created 5 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 #include "ui/views/controls/button/custom_button.h" 5 #include "ui/views/controls/button/custom_button.h"
6 6
7 #include "ui/accessibility/ax_view_state.h" 7 #include "ui/accessibility/ax_view_state.h"
8 #include "ui/events/event.h" 8 #include "ui/events/event.h"
9 #include "ui/events/event_utils.h" 9 #include "ui/events/event_utils.h"
10 #include "ui/events/keycodes/keyboard_codes.h" 10 #include "ui/events/keycodes/keyboard_codes.h"
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 } 305 }
306 306
307 //////////////////////////////////////////////////////////////////////////////// 307 ////////////////////////////////////////////////////////////////////////////////
308 // CustomButton, gfx::AnimationDelegate implementation: 308 // CustomButton, gfx::AnimationDelegate implementation:
309 309
310 void CustomButton::AnimationProgressed(const gfx::Animation* animation) { 310 void CustomButton::AnimationProgressed(const gfx::Animation* animation) {
311 SchedulePaint(); 311 SchedulePaint();
312 } 312 }
313 313
314 //////////////////////////////////////////////////////////////////////////////// 314 ////////////////////////////////////////////////////////////////////////////////
315 // CustomButton, views::InkDropConsumer implementation:
316
317 bool CustomButton::ShouldShowInkDropHover() {
318 return enabled() && IsMouseHovered();
319 }
320
321 ////////////////////////////////////////////////////////////////////////////////
315 // CustomButton, protected: 322 // CustomButton, protected:
316 323
317 CustomButton::CustomButton(ButtonListener* listener) 324 CustomButton::CustomButton(ButtonListener* listener)
318 : Button(listener), 325 : Button(listener),
319 state_(STATE_NORMAL), 326 state_(STATE_NORMAL),
320 animate_on_state_change_(true), 327 animate_on_state_change_(true),
321 is_throbbing_(false), 328 is_throbbing_(false),
322 triggerable_event_flags_(ui::EF_LEFT_MOUSE_BUTTON), 329 triggerable_event_flags_(ui::EF_LEFT_MOUSE_BUTTON),
323 request_focus_on_press_(true), 330 request_focus_on_press_(true),
324 notify_action_(NOTIFY_ON_RELEASE) { 331 notify_action_(NOTIFY_ON_RELEASE) {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 if (!details.is_add && state_ != STATE_DISABLED) 379 if (!details.is_add && state_ != STATE_DISABLED)
373 SetState(STATE_NORMAL); 380 SetState(STATE_NORMAL);
374 } 381 }
375 382
376 void CustomButton::OnBlur() { 383 void CustomButton::OnBlur() {
377 if (IsHotTracked()) 384 if (IsHotTracked())
378 SetState(STATE_NORMAL); 385 SetState(STATE_NORMAL);
379 } 386 }
380 387
381 } // namespace views 388 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698