Chromium Code Reviews| Index: ui/views/controls/slide_out_view.h |
| diff --git a/ui/views/controls/slide_out_view.h b/ui/views/controls/slide_out_view.h |
| index 7fdb637cc7b75a9626f8fcd05595901ae1b82a9e..d8d184c9cdbe7b54a8079196e1870353c0d4fd62 100644 |
| --- a/ui/views/controls/slide_out_view.h |
| +++ b/ui/views/controls/slide_out_view.h |
| @@ -16,9 +16,13 @@ namespace views { |
| class VIEWS_EXPORT SlideOutView : public views::View, |
| public ui::ImplicitAnimationObserver { |
| public: |
| + static void DisableAnimationsForTesting(); |
|
sky
2016/02/16 16:13:06
Constructor/destructor come before other functions
sadrul
2016/02/17 17:29:26
Can you move this into a *TestApi (see other simil
|
| + |
| SlideOutView(); |
| ~SlideOutView() override; |
| + bool slide_out_enabled() { return slide_out_enabled_; } |
| + |
| protected: |
| // Called when user intends to close the View by sliding it out. |
| virtual void OnSlideOut() = 0; |
| @@ -26,12 +30,18 @@ class VIEWS_EXPORT SlideOutView : public views::View, |
| // Overridden from views::View. |
| void OnGestureEvent(ui::GestureEvent* event) override; |
| + void set_slide_out_enabled(bool slide_out_enabled) { |
| + slide_out_enabled_ = slide_out_enabled; |
| + } |
| + |
| private: |
| enum SlideDirection { |
| SLIDE_LEFT, |
| SLIDE_RIGHT, |
| }; |
| + static bool disable_animations_; |
| + |
| // Restores the transform and opacity of the view. |
| void RestoreVisualState(); |
| @@ -41,7 +51,8 @@ class VIEWS_EXPORT SlideOutView : public views::View, |
| // Overridden from ImplicitAnimationObserver. |
| void OnImplicitAnimationsCompleted() override; |
| - float gesture_scroll_amount_; |
| + float gesture_amount_ = 0.f; |
| + bool slide_out_enabled_ = true; |
|
sky
2016/02/16 16:13:06
is_slide_out_enabled_ (and rename functions to mat
yoshiki
2016/02/22 13:39:27
Done.
|
| DISALLOW_COPY_AND_ASSIGN(SlideOutView); |
| }; |