| 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 "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "ui/base/layout.h" | 10 #include "ui/base/layout.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 case InkDropState::HIDDEN: | 87 case InkDropState::HIDDEN: |
| 88 *ink_hidden_ = true; | 88 *ink_hidden_ = true; |
| 89 break; | 89 break; |
| 90 case InkDropState::QUICK_ACTION: | 90 case InkDropState::QUICK_ACTION: |
| 91 case InkDropState::SLOW_ACTION: | 91 case InkDropState::SLOW_ACTION: |
| 92 case InkDropState::DEACTIVATED: | 92 case InkDropState::DEACTIVATED: |
| 93 break; | 93 break; |
| 94 } | 94 } |
| 95 } | 95 } |
| 96 | 96 |
| 97 void SnapToActivated() override { *ink_shown_ = true; } |
| 98 |
| 97 void SetHovered(bool is_hovered) override {} | 99 void SetHovered(bool is_hovered) override {} |
| 98 | 100 |
| 99 private: | 101 private: |
| 100 InkDropHost* ink_drop_host_; | 102 InkDropHost* ink_drop_host_; |
| 101 bool* ink_shown_; | 103 bool* ink_shown_; |
| 102 bool* ink_hidden_; | 104 bool* ink_hidden_; |
| 103 | 105 |
| 104 DISALLOW_COPY_AND_ASSIGN(TestInkDropDelegate); | 106 DISALLOW_COPY_AND_ASSIGN(TestInkDropDelegate); |
| 105 }; | 107 }; |
| 106 | 108 |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 widget()->ReleaseCapture(); | 415 widget()->ReleaseCapture(); |
| 414 SetDraggedView(nullptr); | 416 SetDraggedView(nullptr); |
| 415 EXPECT_TRUE(ink_hidden()); | 417 EXPECT_TRUE(ink_hidden()); |
| 416 EXPECT_EQ(ui::MaterialDesignController::IsModeMaterial() | 418 EXPECT_EQ(ui::MaterialDesignController::IsModeMaterial() |
| 417 ? Button::ButtonState::STATE_NORMAL | 419 ? Button::ButtonState::STATE_NORMAL |
| 418 : Button::ButtonState::STATE_PRESSED, | 420 : Button::ButtonState::STATE_PRESSED, |
| 419 button()->state()); | 421 button()->state()); |
| 420 } | 422 } |
| 421 | 423 |
| 422 } // namespace views | 424 } // namespace views |
| OLD | NEW |