Add default implementations for AppWindowRegistry::Observer notifications.
[chromium-blink-merge.git] / android_webview / browser / browser_view_renderer_client.h
blobfce1c8033275887d4bec0f2879ddddf0e5c975b5
1 // Copyright 2014 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 ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_CLIENT_H_
6 #define ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_CLIENT_H_
8 #include "base/android/scoped_java_ref.h"
9 #include "ui/gfx/geometry/point.h"
10 #include "ui/gfx/geometry/size_f.h"
11 #include "ui/gfx/geometry/vector2d_f.h"
13 namespace android_webview {
15 class BrowserViewRendererClient {
16 public:
17 // Request DrawGL be called. Passing null |canvas| implies the request
18 // will be of AwDrawGLInfo::kModeProcess type. |wait_for_completion|
19 // will cause the call to block until DrawGL has happened; it does not
20 // work when |canvas| is not NULL. The callback may never be made, and
21 // the mode may be promoted to kModeDraw.
22 virtual bool RequestDrawGL(jobject canvas, bool wait_for_completion) = 0;
24 // Called when a new Picture is available. Needs to be enabled
25 // via the EnableOnNewPicture method.
26 virtual void OnNewPicture() = 0;
28 // Called to trigger view invalidations.
29 virtual void PostInvalidate() = 0;
31 // Called to get view's absolute location on the screen.
32 virtual gfx::Point GetLocationOnScreen() = 0;
34 // Try to set the view's scroll offset to |new_value|.
35 virtual void ScrollContainerViewTo(gfx::Vector2d new_value) = 0;
37 // Set the view's scroll offset cap to |new_value|.
38 virtual void SetMaxContainerViewScrollOffset(gfx::Vector2d new_value) = 0;
40 // Is a Android view system managed fling in progress?
41 virtual bool IsFlingActive() const = 0;
43 // Set the current page scale to |page_scale_factor| and page scale limits
44 // to |min_page_scale_factor|..|max_page_scale_factor|.
45 virtual void SetPageScaleFactorAndLimits(float page_scale_factor,
46 float min_page_scale_factor,
47 float max_page_scale_factor) = 0;
49 // Set the current contents_size to |contents_size_dip|.
50 virtual void SetContentsSize(gfx::SizeF contents_size_dip) = 0;
52 // Handle overscroll.
53 virtual void DidOverscroll(gfx::Vector2d overscroll_delta) = 0;
55 protected:
56 virtual ~BrowserViewRendererClient() {}
59 } // namespace android_webview
61 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_CLIENT_H_