Add ICU message format support
[chromium-blink-merge.git] / ui / views / controls / slide_out_view.h
blobb721b3b33b8de82a5d52d25b6e81de645ff38f26
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
3 // found in the LICENSE file.
5 #ifndef UI_VIEWS_CONTROLS_SLIDE_OUT_VIEW_H_
6 #define UI_VIEWS_CONTROLS_SLIDE_OUT_VIEW_H_
8 #include "ui/compositor/layer_animation_observer.h"
9 #include "ui/views/view.h"
10 #include "ui/views/views_export.h"
12 namespace views {
14 // A View that can be closed by a slide-out touch gesture.
15 class VIEWS_EXPORT SlideOutView : public views::View,
16 public ui::ImplicitAnimationObserver {
17 public:
18 SlideOutView();
19 ~SlideOutView() override;
21 protected:
22 // Called when user intends to close the View by sliding it out.
23 virtual void OnSlideOut() = 0;
25 // Overridden from views::View.
26 void OnGestureEvent(ui::GestureEvent* event) override;
28 private:
29 enum SlideDirection {
30 SLIDE_LEFT,
31 SLIDE_RIGHT,
34 // Restores the transform and opacity of the view.
35 void RestoreVisualState();
37 // Slides the view out and closes it after the animation.
38 void SlideOutAndClose(SlideDirection direction);
40 // Overridden from ImplicitAnimationObserver.
41 void OnImplicitAnimationsCompleted() override;
43 float gesture_scroll_amount_;
45 DISALLOW_COPY_AND_ASSIGN(SlideOutView);
48 } // namespace views
50 #endif // UI_VIEWS_CONTROLS_SLIDE_OUT_VIEW_H_