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

Side by Side Diff: ui/views/animation/ink_drop_factory.cc

Issue 2028303004: Hide hover effect on hidden ink drop host views. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/animation/ink_drop_factory.h" 5 #include "ui/views/animation/ink_drop_factory.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "ui/base/material_design/material_design_controller.h" 9 #include "ui/base/material_design/material_design_controller.h"
10 #include "ui/gfx/geometry/rect.h" 10 #include "ui/gfx/geometry/rect.h"
(...skipping 10 matching lines...) Expand all
21 // not enabled. 21 // not enabled.
22 class InkDropStub : public InkDrop { 22 class InkDropStub : public InkDrop {
23 public: 23 public:
24 InkDropStub() {} 24 InkDropStub() {}
25 ~InkDropStub() override {} 25 ~InkDropStub() override {}
26 26
27 // InkDrop: 27 // InkDrop:
28 InkDropState GetTargetInkDropState() const override { 28 InkDropState GetTargetInkDropState() const override {
29 return InkDropState::HIDDEN; 29 return InkDropState::HIDDEN;
30 } 30 }
31 bool IsVisible() const override { return false; }
32 void AnimateToState(InkDropState state) override {} 31 void AnimateToState(InkDropState state) override {}
33 void SnapToActivated() override {} 32 void SnapToActivated() override {}
34 void SetHovered(bool is_hovered) override {} 33 void SetHovered(bool is_hovered) override {}
35 void SetFocused(bool is_hovered) override {} 34 void SetFocused(bool is_hovered) override {}
36 35
37 private: 36 private:
38 DISALLOW_COPY_AND_ASSIGN(InkDropStub); 37 DISALLOW_COPY_AND_ASSIGN(InkDropStub);
39 }; 38 };
40 39
41 } // namespace 40 } // namespace
42 41
43 InkDropFactory::InkDropFactory() {} 42 InkDropFactory::InkDropFactory() {}
44 43
45 InkDropFactory::~InkDropFactory() {} 44 InkDropFactory::~InkDropFactory() {}
46 45
47 std::unique_ptr<InkDrop> InkDropFactory::CreateInkDrop( 46 std::unique_ptr<InkDrop> InkDropFactory::CreateInkDrop(
48 InkDropHost* ink_drop_host) { 47 InkDropHost* ink_drop_host) {
49 if (ui::MaterialDesignController::IsModeMaterial()) { 48 if (ui::MaterialDesignController::IsModeMaterial()) {
50 return base::WrapUnique(new InkDropImpl(ink_drop_host)); 49 return base::WrapUnique(new InkDropImpl(ink_drop_host));
51 } 50 }
52 51
53 return base::WrapUnique(new InkDropStub()); 52 return base::WrapUnique(new InkDropStub());
54 } 53 }
55 54
56 } // namespace views 55 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698