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

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: Created 6 years 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
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 b4c66b26aebc76f1167bbe1418f4f03965eb0b7d..4cb5c32b4f65b2636edd956fb41ab2fae35d34ef 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_.get(); }
jdduke (slow) 2014/12/30 16:37:19 Does just "return gesture_provider_;" work?
dgozman 2015/01/14 14:14:27 Done.
// 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.

Powered by Google App Engine
This is Rietveld 408576698