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

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

Issue 1422593003: Made material design ink drop QUICK_ACTION animation more visible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added varkha@'s behavioural changes Created 5 years, 1 month 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_animation_controller_factory.h" 5 #include "ui/views/animation/ink_drop_animation_controller_factory.h"
6 6
7 #include "ui/base/resource/material_design/material_design_controller.h" 7 #include "ui/base/resource/material_design/material_design_controller.h"
8 #include "ui/gfx/geometry/rect.h" 8 #include "ui/gfx/geometry/rect.h"
9 #include "ui/gfx/geometry/size.h" 9 #include "ui/gfx/geometry/size.h"
10 #include "ui/views/animation/ink_drop_animation_controller.h" 10 #include "ui/views/animation/ink_drop_animation_controller.h"
11 #include "ui/views/animation/ink_drop_animation_controller_impl.h" 11 #include "ui/views/animation/ink_drop_animation_controller_impl.h"
12 #include "ui/views/views_export.h" 12 #include "ui/views/views_export.h"
13 13
14 namespace views { 14 namespace views {
15 15
16 namespace { 16 namespace {
17 17
18 // A stub implementation of an InkDropAnimationController that can be used when 18 // A stub implementation of an InkDropAnimationController that can be used when
19 // material design is not enabled. 19 // material design is not enabled.
20 class InkDropAnimationControllerStub 20 class InkDropAnimationControllerStub
21 : public InkDropAnimationController { 21 : public InkDropAnimationController {
22 public: 22 public:
23 explicit InkDropAnimationControllerStub(); 23 explicit InkDropAnimationControllerStub();
24 ~InkDropAnimationControllerStub() override; 24 ~InkDropAnimationControllerStub() override;
25 25
26 // InkDropAnimationController: 26 // InkDropAnimationController:
27 InkDropState GetInkDropState() const override; 27 InkDropState GetInkDropState() const override;
28 void AnimateToState(InkDropState state) override; 28 void AnimateToState(InkDropState state) override;
29 bool WillAutoAnimateToHidden() const override;
29 void SetHovered(bool is_hovered) override; 30 void SetHovered(bool is_hovered) override;
30 bool IsHovered() const override; 31 bool IsHovered() const override;
31 gfx::Size GetInkDropLargeSize() const override; 32 gfx::Size GetInkDropLargeSize() const override;
32 void SetInkDropSize(const gfx::Size& large_size, 33 void SetInkDropSize(const gfx::Size& large_size,
33 int large_corner_radius, 34 int large_corner_radius,
34 const gfx::Size& small_size, 35 const gfx::Size& small_size,
35 int small_corner_radius) override; 36 int small_corner_radius) override;
36 void SetInkDropCenter(const gfx::Point& center_point) override; 37 void SetInkDropCenter(const gfx::Point& center_point) override;
37 38
38 private: 39 private:
(...skipping 10 matching lines...) Expand all
49 InkDropAnimationControllerStub::~InkDropAnimationControllerStub() {} 50 InkDropAnimationControllerStub::~InkDropAnimationControllerStub() {}
50 51
51 InkDropState InkDropAnimationControllerStub::GetInkDropState() const { 52 InkDropState InkDropAnimationControllerStub::GetInkDropState() const {
52 return InkDropState::HIDDEN; 53 return InkDropState::HIDDEN;
53 } 54 }
54 55
55 void InkDropAnimationControllerStub::AnimateToState(InkDropState state) { 56 void InkDropAnimationControllerStub::AnimateToState(InkDropState state) {
56 SetHovered(false); 57 SetHovered(false);
57 } 58 }
58 59
60 bool InkDropAnimationControllerStub::WillAutoAnimateToHidden() const {
61 return false;
62 }
63
59 void InkDropAnimationControllerStub::SetHovered(bool is_hovered) { 64 void InkDropAnimationControllerStub::SetHovered(bool is_hovered) {
60 is_hovered_ = is_hovered; 65 is_hovered_ = is_hovered;
61 } 66 }
62 67
63 bool InkDropAnimationControllerStub::IsHovered() const { 68 bool InkDropAnimationControllerStub::IsHovered() const {
64 return is_hovered_; 69 return is_hovered_;
65 } 70 }
66 71
67 gfx::Size InkDropAnimationControllerStub::GetInkDropLargeSize() const { 72 gfx::Size InkDropAnimationControllerStub::GetInkDropLargeSize() const {
68 return gfx::Size(); 73 return gfx::Size();
(...skipping 19 matching lines...) Expand all
88 if (ui::MaterialDesignController::IsModeMaterial()) { 93 if (ui::MaterialDesignController::IsModeMaterial()) {
89 return scoped_ptr<InkDropAnimationController>( 94 return scoped_ptr<InkDropAnimationController>(
90 new InkDropAnimationControllerImpl(ink_drop_host)); 95 new InkDropAnimationControllerImpl(ink_drop_host));
91 } 96 }
92 97
93 return scoped_ptr<InkDropAnimationController>( 98 return scoped_ptr<InkDropAnimationController>(
94 new InkDropAnimationControllerStub()); 99 new InkDropAnimationControllerStub());
95 } 100 }
96 101
97 } // namespace views 102 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698