blob: 97e294bc1cc19569c7305755a69131143fe0e9a4 [file] [log] [blame]
[email protected]b4df9df2012-11-16 01:58:581// 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.
4
5#ifndef CONTENT_BROWSER_RENDERER_HOST_OVERSCROLL_CONTROLLER_DELEGATE_H_
6#define CONTENT_BROWSER_RENDERER_HOST_OVERSCROLL_CONTROLLER_DELEGATE_H_
7
[email protected]b4df9df2012-11-16 01:58:588#include "base/compiler_specific.h"
avib533f5d2015-12-25 03:11:159#include "base/macros.h"
[email protected]b4df9df2012-11-16 01:58:5810#include "content/browser/renderer_host/overscroll_controller.h"
nsatragnoc0b2fa52015-04-09 22:30:5111#include "content/common/content_export.h"
tfarina3b0452d2014-12-31 15:20:0912#include "ui/gfx/geometry/rect.h"
[email protected]b4df9df2012-11-16 01:58:5813
14namespace content {
15
16// The delegate receives overscroll gesture updates from the controller and
17// should perform appropriate actions.
nsatragnoc0b2fa52015-04-09 22:30:5118class CONTENT_EXPORT OverscrollControllerDelegate {
[email protected]b4df9df2012-11-16 01:58:5819 public:
[email protected]e42b1f82012-11-16 21:18:4620 OverscrollControllerDelegate() {}
[email protected]b4df9df2012-11-16 01:58:5821 virtual ~OverscrollControllerDelegate() {}
22
[email protected]fc4b06d02013-10-23 20:47:1123 // Get the bounds of the view corresponding to the delegate. Overscroll-ending
24 // events will only be processed if the visible bounds are non-empty.
25 virtual gfx::Rect GetVisibleBounds() const = 0;
26
[email protected]bfab3d02014-08-20 03:16:5527 // This is called for each update in the overscroll amount. Returns true if
28 // the delegate consumed the event.
29 virtual bool OnOverscrollUpdate(float delta_x, float delta_y) = 0;
[email protected]b4df9df2012-11-16 01:58:5830
31 // This is called when the overscroll completes.
32 virtual void OnOverscrollComplete(OverscrollMode overscroll_mode) = 0;
33
34 // This is called when the direction of the overscroll changes.
mfomitchev09f0d64a2017-03-02 19:40:0735 // When a new overscroll is started (i.e. when |new_mode| is not
36 // equal to OVERSCROLL_NONE), |source| will be set to the device that
37 // triggered the overscroll gesture.
[email protected]b4df9df2012-11-16 01:58:5838 virtual void OnOverscrollModeChange(OverscrollMode old_mode,
mfomitchev09f0d64a2017-03-02 19:40:0739 OverscrollMode new_mode,
40 OverscrollSource source) = 0;
[email protected]b4df9df2012-11-16 01:58:5841
42 private:
43 DISALLOW_COPY_AND_ASSIGN(OverscrollControllerDelegate);
44};
45
46} // namespace content
47
48#endif // CONTENT_BROWSER_RENDERER_HOST_OVERSCROLL_CONTROLLER_DELEGATE_H_