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

Unified Diff: content/renderer/render_widget.h

Issue 10837330: Add a completion callback to gpuBenchmarking.beginSmoothScroll (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: virtual and todo note Created 8 years, 4 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
« no previous file with comments | « content/renderer/gpu/gpu_benchmarking_extension.cc ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.h
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h
index 79a689cc6554540ddc23a8bdec97c3ad304544c2..89c567002bab35fec0bec8a729d5b3363489c32f 100644
--- a/content/renderer/render_widget.h
+++ b/content/renderer/render_widget.h
@@ -6,6 +6,7 @@
#define CONTENT_RENDERER_RENDER_WIDGET_H_
#include <deque>
+#include <map>
#include <vector>
#include "base/basictypes.h"
@@ -159,9 +160,15 @@ class CONTENT_EXPORT RenderWidget
// as it blocks on the compositor thread.
void GetRenderingStats(WebKit::WebRenderingStats&) const;
+ // Callback for use with BeginSmoothScroll.
+ typedef base::Callback<void()> SmoothScrollCompletionCallback;
+
// Directs the host to begin a smooth scroll. This scroll should have the same
- // performance characteristics as a user-initiated scroll.
- void BeginSmoothScroll(bool scroll_down, bool scroll_far);
+ // performance characteristics as a user-initiated scroll. Returns an ID of
+ // the scroll gesture.
+ void BeginSmoothScroll(bool scroll_down,
+ bool scroll_far,
+ const SmoothScrollCompletionCallback& callback);
// Close the underlying WebWidget.
virtual void Close();
@@ -265,6 +272,7 @@ class CONTENT_EXPORT RenderWidget
const gfx::Size& page_size,
const gfx::Size& desired_size);
void OnMsgRepaint(const gfx::Size& size_to_paint);
+ void OnMsgSmoothScrollCompleted(int gesture_id);
virtual void OnSetDeviceScaleFactor(float device_scale_factor);
void OnSetTextDirection(WebKit::WebTextDirection direction);
void OnGetFPS();
@@ -578,6 +586,12 @@ class CONTENT_EXPORT RenderWidget
// Specifies whether input event throttling is enabled for this widget.
bool throttle_input_events_;
+ // State associated with the BeginSmoothScroll synthetic scrolling function.
+ int next_smooth_scroll_gesture_id_;
+ typedef std::map<int, SmoothScrollCompletionCallback>
+ PendingSmoothScrollGestureMap;
+ PendingSmoothScrollGestureMap pending_smooth_scroll_gestures_;
+
DISALLOW_COPY_AND_ASSIGN(RenderWidget);
};
« no previous file with comments | « content/renderer/gpu/gpu_benchmarking_extension.cc ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698