| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 class TestInkDropDelegateThatTracksVisibilty : public InkDropDelegate { | 88 class TestInkDropDelegateThatTracksVisibilty : public InkDropDelegate { |
| 89 public: | 89 public: |
| 90 TestInkDropDelegateThatTracksVisibilty(bool* ink_shown, bool* ink_hidden) | 90 TestInkDropDelegateThatTracksVisibilty(bool* ink_shown, bool* ink_hidden) |
| 91 : ink_shown_(ink_shown), ink_hidden_(ink_hidden) {} | 91 : ink_shown_(ink_shown), ink_hidden_(ink_hidden) {} |
| 92 ~TestInkDropDelegateThatTracksVisibilty() override {} | 92 ~TestInkDropDelegateThatTracksVisibilty() override {} |
| 93 | 93 |
| 94 // InkDropDelegate: | 94 // InkDropDelegate: |
| 95 void OnAction(InkDropState state) override { | 95 void OnAction(InkDropState state) override { |
| 96 switch (state) { | 96 switch (state) { |
| 97 case InkDropState::ACTION_PENDING: | 97 case InkDropState::ACTION_PENDING: |
| 98 case InkDropState::SLOW_ACTION_PENDING: | 98 case InkDropState::ALTERNATE_ACTION_PENDING: |
| 99 case InkDropState::ACTIVATED: | 99 case InkDropState::ACTIVATED: |
| 100 *ink_shown_ = true; | 100 *ink_shown_ = true; |
| 101 break; | 101 break; |
| 102 case InkDropState::HIDDEN: | 102 case InkDropState::HIDDEN: |
| 103 *ink_hidden_ = true; | 103 *ink_hidden_ = true; |
| 104 break; | 104 break; |
| 105 case InkDropState::QUICK_ACTION: | 105 case InkDropState::ACTION_TRIGGERED: |
| 106 case InkDropState::SLOW_ACTION: | 106 case InkDropState::ALTERNATE_ACTION_TRIGGERED: |
| 107 case InkDropState::DEACTIVATED: | 107 case InkDropState::DEACTIVATED: |
| 108 break; | 108 break; |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 | 111 |
| 112 void SnapToActivated() override { *ink_shown_ = true; } | 112 void SnapToActivated() override { *ink_shown_ = true; } |
| 113 | 113 |
| 114 void SetHovered(bool is_hovered) override {} | 114 void SetHovered(bool is_hovered) override {} |
| 115 | 115 |
| 116 private: | 116 private: |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 ink_drop_delegate->SetHovered(true); | 456 ink_drop_delegate->SetHovered(true); |
| 457 ink_drop_delegate->OnAction(InkDropState::ACTION_PENDING); | 457 ink_drop_delegate->OnAction(InkDropState::ACTION_PENDING); |
| 458 | 458 |
| 459 button()->ShowContextMenu(gfx::Point(), ui::MENU_SOURCE_MOUSE); | 459 button()->ShowContextMenu(gfx::Point(), ui::MENU_SOURCE_MOUSE); |
| 460 | 460 |
| 461 EXPECT_TRUE(ink_drop_delegate->is_hovered()); | 461 EXPECT_TRUE(ink_drop_delegate->is_hovered()); |
| 462 EXPECT_EQ(InkDropState::ACTION_PENDING, ink_drop_delegate->state()); | 462 EXPECT_EQ(InkDropState::ACTION_PENDING, ink_drop_delegate->state()); |
| 463 } | 463 } |
| 464 | 464 |
| 465 } // namespace views | 465 } // namespace views |
| OLD | NEW |