| OLD | NEW |
| 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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 //////////////////////////////////////////////////////////////////////////////// | 431 //////////////////////////////////////////////////////////////////////////////// |
| 432 // CustomButton, protected: | 432 // CustomButton, protected: |
| 433 | 433 |
| 434 CustomButton::CustomButton(ButtonListener* listener) | 434 CustomButton::CustomButton(ButtonListener* listener) |
| 435 : Button(listener), | 435 : Button(listener), |
| 436 state_(STATE_NORMAL), | 436 state_(STATE_NORMAL), |
| 437 hover_animation_(this), | 437 hover_animation_(this), |
| 438 animate_on_state_change_(true), | 438 animate_on_state_change_(true), |
| 439 is_throbbing_(false), | 439 is_throbbing_(false), |
| 440 triggerable_event_flags_(ui::EF_LEFT_MOUSE_BUTTON), | 440 triggerable_event_flags_(ui::EF_LEFT_MOUSE_BUTTON), |
| 441 request_focus_on_press_(true), | 441 request_focus_on_press_(false), |
| 442 ink_drop_delegate_(nullptr), | 442 ink_drop_delegate_(nullptr), |
| 443 notify_action_(NOTIFY_ON_RELEASE), | 443 notify_action_(NOTIFY_ON_RELEASE), |
| 444 has_ink_drop_action_on_click_(false), | 444 has_ink_drop_action_on_click_(false), |
| 445 ink_drop_action_on_click_(InkDropState::ACTION_TRIGGERED), | 445 ink_drop_action_on_click_(InkDropState::ACTION_TRIGGERED), |
| 446 hide_ink_drop_when_showing_context_menu_(true), | 446 hide_ink_drop_when_showing_context_menu_(true), |
| 447 ink_drop_base_color_(gfx::kPlaceholderColor), | 447 ink_drop_base_color_(gfx::kPlaceholderColor), |
| 448 md_focus_ring_(nullptr) { | 448 md_focus_ring_(nullptr) { |
| 449 hover_animation_.SetSlideDuration(kHoverFadeDurationMs); | 449 hover_animation_.SetSlideDuration(kHoverFadeDurationMs); |
| 450 } | 450 } |
| 451 | 451 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 Button::NotifyClick(event); | 508 Button::NotifyClick(event); |
| 509 } | 509 } |
| 510 | 510 |
| 511 void CustomButton::OnClickCanceled(const ui::Event& event) { | 511 void CustomButton::OnClickCanceled(const ui::Event& event) { |
| 512 if (ink_drop_delegate()) | 512 if (ink_drop_delegate()) |
| 513 ink_drop_delegate()->OnAction(views::InkDropState::HIDDEN); | 513 ink_drop_delegate()->OnAction(views::InkDropState::HIDDEN); |
| 514 Button::OnClickCanceled(event); | 514 Button::OnClickCanceled(event); |
| 515 } | 515 } |
| 516 | 516 |
| 517 } // namespace views | 517 } // namespace views |
| OLD | NEW |