Chromium Code Reviews| Index: ui/android/overscroll_refresh_handler.h |
| diff --git a/ui/android/overscroll_refresh_handler.h b/ui/android/overscroll_refresh_handler.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..03aad695bbdc481df1ad99251a512f9b926e6005 |
| --- /dev/null |
| +++ b/ui/android/overscroll_refresh_handler.h |
| @@ -0,0 +1,38 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef UI_ANDROID_OVERSCROLL_REFRESH_HANDLER_H |
| +#define UI_ANDROID_OVERSCROLL_REFRESH_HANDLER_H |
| + |
| +#include "base/android/scoped_java_ref.h" |
| +#include "ui/android/ui_android_export.h" |
| + |
| +namespace ui { |
| + |
| +class UI_ANDROID_EXPORT OverscrollRefreshHandler { |
| + public: |
| + explicit OverscrollRefreshHandler( |
| + const base::android::JavaRef<jobject>& j_overscroll_refresh_handler); |
| + ~OverscrollRefreshHandler(); |
| + // Signals the start of an overscrolling pull. Returns whether the handler |
| + // will consume the overscroll gesture, in which case it will receive the |
| + // remaining pull updates. |
| + bool PullStart(); |
| + |
| + // Signals a pull update, where |delta| is in device pixels. |
| + void PullUpdate(float delta); |
| + |
| + // Signals the release of the pull, and whether the release is allowed to |
| + // trigger the refresh action. |
| + void PullRelease(bool allow_refresh); |
| + |
| + // Reset the active pull state. |
| + void PullReset(); |
| + |
| + private: |
| + base::android::ScopedJavaGlobalRef<jobject> j_overscroll_refresh_handler_; |
| +}; |
|
boliu
2016/12/06 00:58:16
nit: empty line below
rlanday
2016/12/06 03:25:26
Ok
|
| +} |
| + |
| +#endif // UI_ANDROID_OVERSCROLL_REFRESH_HANDLER_H |