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

Unified Diff: ui/views/controls/slide_out_view.h

Issue 1645843003: Implement Non-Closable Notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed the comments Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
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..6d7d6b70bd0fb3b24fdcacff36c653e414df9b65 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();
+
SlideOutView();
~SlideOutView() override;
+ bool slide_out_enable() { return slide_out_enable_; }
dewittj 2016/02/08 18:02:34 nit: slide_out_enabled
yoshiki 2016/02/09 23:42:25 Done.
+
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_enable(bool slide_out_enable) {
+ slide_out_enable_ = slide_out_enable;
+ }
+
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_enable_ = true;
DISALLOW_COPY_AND_ASSIGN(SlideOutView);
};

Powered by Google App Engine
This is Rietveld 408576698