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

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

Issue 1832963002: MD - add ripples to DL shelf items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix another TODO Created 4 years, 8 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 #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/base/material_design/material_design_controller.h" 8 #include "ui/base/material_design/material_design_controller.h"
9 #include "ui/events/event.h" 9 #include "ui/events/event.h"
10 #include "ui/events/event_utils.h" 10 #include "ui/events/event_utils.h"
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 : Button(listener), 426 : Button(listener),
427 state_(STATE_NORMAL), 427 state_(STATE_NORMAL),
428 hover_animation_(this), 428 hover_animation_(this),
429 animate_on_state_change_(true), 429 animate_on_state_change_(true),
430 is_throbbing_(false), 430 is_throbbing_(false),
431 triggerable_event_flags_(ui::EF_LEFT_MOUSE_BUTTON), 431 triggerable_event_flags_(ui::EF_LEFT_MOUSE_BUTTON),
432 request_focus_on_press_(true), 432 request_focus_on_press_(true),
433 ink_drop_delegate_(nullptr), 433 ink_drop_delegate_(nullptr),
434 notify_action_(NOTIFY_ON_RELEASE), 434 notify_action_(NOTIFY_ON_RELEASE),
435 has_ink_drop_action_on_click_(false), 435 has_ink_drop_action_on_click_(false),
436 ink_drop_action_on_click_(InkDropState::QUICK_ACTION), 436 ink_drop_action_on_click_(InkDropState::ACTION_TRIGGERED),
437 ink_drop_base_color_(gfx::kPlaceholderColor), 437 ink_drop_base_color_(gfx::kPlaceholderColor),
438 md_focus_ring_(nullptr) { 438 md_focus_ring_(nullptr) {
439 hover_animation_.SetSlideDuration(kHoverFadeDurationMs); 439 hover_animation_.SetSlideDuration(kHoverFadeDurationMs);
440 } 440 }
441 441
442 void CustomButton::StateChanged() { 442 void CustomButton::StateChanged() {
443 } 443 }
444 444
445 bool CustomButton::IsTriggerableEvent(const ui::Event& event) { 445 bool CustomButton::IsTriggerableEvent(const ui::Event& event) {
446 return event.type() == ui::ET_GESTURE_TAP_DOWN || 446 return event.type() == ui::ET_GESTURE_TAP_DOWN ||
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 Button::NotifyClick(event); 498 Button::NotifyClick(event);
499 } 499 }
500 500
501 void CustomButton::OnClickCanceled(const ui::Event& event) { 501 void CustomButton::OnClickCanceled(const ui::Event& event) {
502 if (ink_drop_delegate()) 502 if (ink_drop_delegate())
503 ink_drop_delegate()->OnAction(views::InkDropState::HIDDEN); 503 ink_drop_delegate()->OnAction(views::InkDropState::HIDDEN);
504 Button::OnClickCanceled(event); 504 Button::OnClickCanceled(event);
505 } 505 }
506 506
507 } // namespace views 507 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/animation/square_ink_drop_animation.cc ('k') | ui/views/controls/button/custom_button_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698