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

Unified Diff: content/browser/renderer_host/input/touch_emulator.h

Issue 820053002: Touch emulator: create/destroy gesture provider on the fly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed comments Created 5 years, 11 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 | « no previous file | content/browser/renderer_host/input/touch_emulator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/input/touch_emulator.h
diff --git a/content/browser/renderer_host/input/touch_emulator.h b/content/browser/renderer_host/input/touch_emulator.h
index 9ddb725342736c0235e6aedc9da45cecd1a1c7be..ea74f6292f849e06a94a8a600453a2595355ce81 100644
--- a/content/browser/renderer_host/input/touch_emulator.h
+++ b/content/browser/renderer_host/input/touch_emulator.h
@@ -25,7 +25,7 @@ class CONTENT_EXPORT TouchEmulator : public ui::GestureProviderClient {
// Note that TouchEmulator should always listen to touch events and their acks
// (even in disabled state) to track native stream presence.
- bool enabled() const { return enabled_; }
+ bool enabled() const { return gesture_provider_; }
// Returns |true| if the event was consumed. Consumed event should not
// propagate any further.
@@ -71,11 +71,11 @@ class CONTENT_EXPORT TouchEmulator : public ui::GestureProviderClient {
void HandleEmulatedTouchEvent(blink::WebTouchEvent event);
TouchEmulatorClient* const client_;
- ui::FilteredGestureProvider gesture_provider_;
+ // Emulator is enabled iff gesture provider is created.
// Disabled emulator does only process touch acks left from previous
// emulation. It does not intercept any events.
- bool enabled_;
+ scoped_ptr<ui::FilteredGestureProvider> gesture_provider_;
// While emulation is on, default cursor is touch. Pressing shift changes
// cursor to the pinch one.
« no previous file with comments | « no previous file | content/browser/renderer_host/input/touch_emulator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698