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

Side by Side Diff: ui/views/animation/test/test_ink_drop_delegate.cc

Issue 2041033002: Moved ButtonInkDropDelegate logic into InkDropHostView and deleted InkDropDelegates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed merge conflict in custom_button.cc Created 4 years, 6 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/views/animation/ink_drop.h"
6 #include "ui/views/animation/test/test_ink_drop_delegate.h"
7
8 namespace views {
9 namespace test {
10
11 class TestInkDrop : public InkDrop {
12 public:
13 TestInkDrop() : InkDrop() {}
14 ~TestInkDrop() override {}
15
16 InkDropState GetTargetInkDropState() const override {
17 NOTREACHED();
18 return InkDropState::HIDDEN;
19 }
20
21 bool IsVisible() const override {
22 NOTREACHED();
23 return false;
24 }
25 void AnimateToState(InkDropState ink_drop_state) override { NOTREACHED(); }
26 void SnapToActivated() override { NOTREACHED(); }
27 void SetHovered(bool is_hovered) override { NOTREACHED(); }
28 void SetFocused(bool is_focused) override {}
29
30 private:
31 DISALLOW_COPY_AND_ASSIGN(TestInkDrop);
32 };
33
34 TestInkDropDelegate::TestInkDropDelegate()
35 : state_(InkDropState::HIDDEN), is_hovered_(false) {}
36
37 TestInkDropDelegate::~TestInkDropDelegate() {}
38
39 void TestInkDropDelegate::OnAction(InkDropState state) {
40 state_ = state;
41 }
42
43 void TestInkDropDelegate::SnapToActivated() {
44 state_ = InkDropState::ACTIVATED;
45 }
46
47 void TestInkDropDelegate::SetHovered(bool is_hovered) {
48 is_hovered_ = is_hovered;
49 }
50
51 InkDropState TestInkDropDelegate::GetTargetInkDropState() const {
52 return state_;
53 }
54
55 InkDrop* TestInkDropDelegate::GetInkDrop() {
56 if (!ink_drop_.get())
57 ink_drop_.reset(new TestInkDrop);
58 return ink_drop_.get();
59 }
60
61 } // namespace test
62 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/animation/test/test_ink_drop_delegate.h ('k') | ui/views/controls/button/custom_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698