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

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

Issue 1757993004: Added ink drop hover/ripple to menu hosting bookmark buttons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated the ripple to behave resonably when showing context menus. Created 4 years, 9 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 "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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698