| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/events/gesture_detection/gesture_provider.h" | 5 #include "ui/events/gesture_detection/gesture_provider.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 center.x() - width / 2.f, center.y() - height / 2.f, width, height); | 58 center.x() - width / 2.f, center.y() - height / 2.f, width, height); |
| 59 } | 59 } |
| 60 | 60 |
| 61 } // namespace | 61 } // namespace |
| 62 | 62 |
| 63 // GestureProvider:::Config | 63 // GestureProvider:::Config |
| 64 | 64 |
| 65 GestureProvider::Config::Config() | 65 GestureProvider::Config::Config() |
| 66 : display(gfx::Display::kInvalidDisplayID, gfx::Rect(1, 1)), | 66 : display(gfx::Display::kInvalidDisplayID, gfx::Rect(1, 1)), |
| 67 disable_click_delay(false), | 67 disable_click_delay(false), |
| 68 double_tap_support_for_platform_enabled(true), |
| 68 gesture_begin_end_types_enabled(false), | 69 gesture_begin_end_types_enabled(false), |
| 69 min_gesture_bounds_length(0), | 70 min_gesture_bounds_length(0), |
| 70 max_gesture_bounds_length(0) { | 71 max_gesture_bounds_length(0) { |
| 71 } | 72 } |
| 72 | 73 |
| 73 GestureProvider::Config::~Config() { | 74 GestureProvider::Config::~Config() { |
| 74 } | 75 } |
| 75 | 76 |
| 76 // GestureProvider::GestureListener | 77 // GestureProvider::GestureListener |
| 77 | 78 |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 bool show_press_event_sent_; | 674 bool show_press_event_sent_; |
| 674 | 675 |
| 675 DISALLOW_COPY_AND_ASSIGN(GestureListenerImpl); | 676 DISALLOW_COPY_AND_ASSIGN(GestureListenerImpl); |
| 676 }; | 677 }; |
| 677 | 678 |
| 678 // GestureProvider | 679 // GestureProvider |
| 679 | 680 |
| 680 GestureProvider::GestureProvider(const Config& config, | 681 GestureProvider::GestureProvider(const Config& config, |
| 681 GestureProviderClient* client) | 682 GestureProviderClient* client) |
| 682 : double_tap_support_for_page_(true), | 683 : double_tap_support_for_page_(true), |
| 683 double_tap_support_for_platform_(true), | 684 double_tap_support_for_platform_( |
| 685 config.double_tap_support_for_platform_enabled), |
| 684 gesture_begin_end_types_enabled_(config.gesture_begin_end_types_enabled) { | 686 gesture_begin_end_types_enabled_(config.gesture_begin_end_types_enabled) { |
| 685 DCHECK(client); | 687 DCHECK(client); |
| 686 DCHECK(!config.min_gesture_bounds_length || | 688 DCHECK(!config.min_gesture_bounds_length || |
| 687 !config.max_gesture_bounds_length || | 689 !config.max_gesture_bounds_length || |
| 688 config.min_gesture_bounds_length <= config.max_gesture_bounds_length); | 690 config.min_gesture_bounds_length <= config.max_gesture_bounds_length); |
| 689 TRACE_EVENT0("input", "GestureProvider::InitGestureDetectors"); | 691 TRACE_EVENT0("input", "GestureProvider::InitGestureDetectors"); |
| 690 gesture_listener_.reset(new GestureListenerImpl(config, client)); | 692 gesture_listener_.reset(new GestureListenerImpl(config, client)); |
| 691 UpdateDoubleTapDetectionSupport(); | 693 UpdateDoubleTapDetectionSupport(); |
| 692 } | 694 } |
| 693 | 695 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 821 // null'ing of the listener until the sequence has ended. | 823 // null'ing of the listener until the sequence has ended. |
| 822 if (current_down_event_) | 824 if (current_down_event_) |
| 823 return; | 825 return; |
| 824 | 826 |
| 825 const bool double_tap_enabled = | 827 const bool double_tap_enabled = |
| 826 double_tap_support_for_page_ && double_tap_support_for_platform_; | 828 double_tap_support_for_page_ && double_tap_support_for_platform_; |
| 827 gesture_listener_->SetDoubleTapEnabled(double_tap_enabled); | 829 gesture_listener_->SetDoubleTapEnabled(double_tap_enabled); |
| 828 } | 830 } |
| 829 | 831 |
| 830 } // namespace ui | 832 } // namespace ui |
| OLD | NEW |