diff options
Diffstat (limited to 'chromium/content/public/browser/overscroll_configuration.h')
-rw-r--r-- | chromium/content/public/browser/overscroll_configuration.h | 50 |
1 files changed, 38 insertions, 12 deletions
diff --git a/chromium/content/public/browser/overscroll_configuration.h b/chromium/content/public/browser/overscroll_configuration.h index 2f593f5b8a8..1cfca76392c 100644 --- a/chromium/content/public/browser/overscroll_configuration.h +++ b/chromium/content/public/browser/overscroll_configuration.h @@ -12,20 +12,32 @@ namespace content { class CONTENT_EXPORT OverscrollConfig { public: - // Determines overscroll history navigation mode according to its - // corresponding flag. - enum class Mode { - // Overscroll history navigation is disabled. + // Determines overscroll history navigation mode according to + // --overscroll-history-navigation flag. + enum class HistoryNavigationMode { + // History navigation is disabled. kDisabled, - // Overscroll history navigation is enabled and uses the UI with parallax - // effect and screenshots. + // History navigation is enabled and uses the UI with parallax effect and + // screenshots. kParallaxUi, - // Overscroll history navigation is enabled and uses the simplified UI. + // History navigation is enabled and uses the simplified UI. kSimpleUi, }; + // Determines pull-to-refresh mode according to --pull-to-refresh flag. + enum class PullToRefreshMode { + // Pull-to-refresh is disabled. + kDisabled, + + // Pull-to-refresh is enabled for both touchscreen and touchpad. + kEnabled, + + // Pull-to-refresh is enabled only for touchscreen. + kEnabledTouchschreen, + }; + // Specifies an overscroll controller threshold. enum class Threshold { // Threshold to complete touchpad overscroll, in terms of the percentage of @@ -43,17 +55,31 @@ class CONTENT_EXPORT OverscrollConfig { kStartTouchscreen, }; - static Mode GetMode(); + static HistoryNavigationMode GetHistoryNavigationMode(); + static PullToRefreshMode GetPullToRefreshMode(); static float GetThreshold(Threshold threshold); + static bool TouchpadOverscrollHistoryNavigationEnabled(); + private: - friend class ScopedOverscrollMode; + friend class ScopedHistoryNavigationMode; + friend class ScopedPullToRefreshMode; + friend class OverscrollControllerTest; + + // Helper functions used by |ScopedHistoryNavigationMode| to set and reset + // mode in tests. + static void SetHistoryNavigationMode(HistoryNavigationMode mode); + static void ResetHistoryNavigationMode(); + + // Helper functions used by |ScopedPullToRefreshMode| to set and reset mode in + // tests. + static void SetPullToRefreshMode(PullToRefreshMode mode); + static void ResetPullToRefreshMode(); - // Helper functions used by |ScopedOverscrollMode| to set and reset mode in + // Helper functions to reset TouchpadOverscrollHistoryNavigationEnabled in // tests. - static void SetMode(Mode mode); - static void ResetMode(); + static void ResetTouchpadOverscrollHistoryNavigationEnabled(); DISALLOW_IMPLICIT_CONSTRUCTORS(OverscrollConfig); }; |