| 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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 break; | 372 break; |
| 373 } | 373 } |
| 374 } | 374 } |
| 375 | 375 |
| 376 void CustomButton::VisibilityChanged(View* starting_from, bool visible) { | 376 void CustomButton::VisibilityChanged(View* starting_from, bool visible) { |
| 377 if (state_ == STATE_DISABLED) | 377 if (state_ == STATE_DISABLED) |
| 378 return; | 378 return; |
| 379 SetState(visible && ShouldEnterHoveredState() ? STATE_HOVERED : STATE_NORMAL); | 379 SetState(visible && ShouldEnterHoveredState() ? STATE_HOVERED : STATE_NORMAL); |
| 380 } | 380 } |
| 381 | 381 |
| 382 scoped_ptr<InkDropHover> CustomButton::CreateInkDropHover() const { | 382 std::unique_ptr<InkDropHover> CustomButton::CreateInkDropHover() const { |
| 383 return ShouldShowInkDropHover() ? Button::CreateInkDropHover() : nullptr; | 383 return ShouldShowInkDropHover() ? Button::CreateInkDropHover() : nullptr; |
| 384 } | 384 } |
| 385 | 385 |
| 386 SkColor CustomButton::GetInkDropBaseColor() const { | 386 SkColor CustomButton::GetInkDropBaseColor() const { |
| 387 return ink_drop_base_color_; | 387 return ink_drop_base_color_; |
| 388 } | 388 } |
| 389 | 389 |
| 390 //////////////////////////////////////////////////////////////////////////////// | 390 //////////////////////////////////////////////////////////////////////////////// |
| 391 // CustomButton, gfx::AnimationDelegate implementation: | 391 // CustomButton, gfx::AnimationDelegate implementation: |
| 392 | 392 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 Button::NotifyClick(event); | 504 Button::NotifyClick(event); |
| 505 } | 505 } |
| 506 | 506 |
| 507 void CustomButton::OnClickCanceled(const ui::Event& event) { | 507 void CustomButton::OnClickCanceled(const ui::Event& event) { |
| 508 if (ink_drop_delegate()) | 508 if (ink_drop_delegate()) |
| 509 ink_drop_delegate()->OnAction(views::InkDropState::HIDDEN); | 509 ink_drop_delegate()->OnAction(views::InkDropState::HIDDEN); |
| 510 Button::OnClickCanceled(event); | 510 Button::OnClickCanceled(event); |
| 511 } | 511 } |
| 512 | 512 |
| 513 } // namespace views | 513 } // namespace views |
| OLD | NEW |