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

Unified Diff: chrome/browser/resources/shared/js/cr/ui/touch_handler.js

Issue 8775024: Fix NTP not to slide with mouse (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't include tweak to enable Xinput2 Created 9 years, 1 month 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 | « chrome/browser/resources/shared/js/cr/ui/card_slider.js ('k') | chrome/browser/resources/touchhandler.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/shared/js/cr/ui/touch_handler.js
diff --git a/chrome/browser/resources/shared/js/cr/ui/touch_handler.js b/chrome/browser/resources/shared/js/cr/ui/touch_handler.js
index b9840b5ae7ab6686de643630911c85981e98082e..7744260c2f9577e965cfe305fdc81febabbf3276 100644
--- a/chrome/browser/resources/shared/js/cr/ui/touch_handler.js
+++ b/chrome/browser/resources/shared/js/cr/ui/touch_handler.js
@@ -335,8 +335,10 @@ cr.define('cr.ui', function() {
* Start listenting for events.
* @param {boolean=} opt_capture True if the TouchHandler should listen to
* during the capture phase.
+ * @param {boolean=} opt_mouse True if the TouchHandler should generate
+ * events for mouse input (in addition to touch input).
*/
- enable: function(opt_capture) {
+ enable: function(opt_capture, opt_mouse) {
var capture = !!opt_capture;
// Just listen to start events for now. When a touch is occuring we'll
@@ -344,9 +346,11 @@ cr.define('cr.ui', function() {
// don't want to incur the cost of lots of no-op handlers on the document.
this.events_.add(this.element_, 'touchstart', this.onStart_.bind(this),
capture);
- this.events_.add(this.element_, 'mousedown',
- this.mouseToTouchCallback_(this.onStart_.bind(this)),
- capture);
+ if (opt_mouse) {
+ this.events_.add(this.element_, 'mousedown',
+ this.mouseToTouchCallback_(this.onStart_.bind(this)),
+ capture);
+ }
// If the element is long-pressed, we may need to swallow a click
this.events_.add(this.element_, 'click', this.onClick_.bind(this), true);
« no previous file with comments | « chrome/browser/resources/shared/js/cr/ui/card_slider.js ('k') | chrome/browser/resources/touchhandler.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698