| 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 "content/browser/renderer_host/input/touch_emulator.h" | 5 #include "content/browser/renderer_host/input/touch_emulator.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 if (ack_touches_synchronously_) { | 80 if (ack_touches_synchronously_) { |
| 81 emulator()->HandleTouchEventAck( | 81 emulator()->HandleTouchEventAck( |
| 82 event, INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS); | 82 event, INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS); |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 | 85 |
| 86 void SetCursor(const WebCursor& cursor) override { | 86 void SetCursor(const WebCursor& cursor) override { |
| 87 cursor_ = cursor; | 87 cursor_ = cursor; |
| 88 } | 88 } |
| 89 | 89 |
| 90 void ShowContextMenuAtPoint(const gfx::Point& point) override {} | 90 void ShowContextMenuAtPoint(const gfx::Point& point, |
| 91 bool from_touch_handle) override {} |
| 91 | 92 |
| 92 protected: | 93 protected: |
| 93 TouchEmulator* emulator() const { | 94 TouchEmulator* emulator() const { |
| 94 return emulator_.get(); | 95 return emulator_.get(); |
| 95 } | 96 } |
| 96 | 97 |
| 97 int modifiers() const { | 98 int modifiers() const { |
| 98 return (shift_pressed_ ? WebInputEvent::kShiftKey : 0) | | 99 return (shift_pressed_ ? WebInputEvent::kShiftKey : 0) | |
| 99 (mouse_pressed_ ? WebInputEvent::kLeftButtonDown : 0); | 100 (mouse_pressed_ ? WebInputEvent::kLeftButtonDown : 0); |
| 100 } | 101 } |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 emulator()->SetDeviceScaleFactor(1.0f); | 591 emulator()->SetDeviceScaleFactor(1.0f); |
| 591 EXPECT_EQ(1.0f, GetCursorScaleFactor()); | 592 EXPECT_EQ(1.0f, GetCursorScaleFactor()); |
| 592 | 593 |
| 593 TouchEmulator another(this, 4.0f); | 594 TouchEmulator another(this, 4.0f); |
| 594 EXPECT_EQ(1.0f, GetCursorScaleFactor()); | 595 EXPECT_EQ(1.0f, GetCursorScaleFactor()); |
| 595 another.Enable(ui::GestureProviderConfigType::GENERIC_MOBILE); | 596 another.Enable(ui::GestureProviderConfigType::GENERIC_MOBILE); |
| 596 EXPECT_EQ(2.0f, GetCursorScaleFactor()); | 597 EXPECT_EQ(2.0f, GetCursorScaleFactor()); |
| 597 } | 598 } |
| 598 | 599 |
| 599 } // namespace content | 600 } // namespace content |
| OLD | NEW |