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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 if (ack_touches_synchronously_) { | 78 if (ack_touches_synchronously_) { |
79 emulator()->HandleTouchEventAck( | 79 emulator()->HandleTouchEventAck( |
80 event, INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS); | 80 event, INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS); |
81 } | 81 } |
82 } | 82 } |
83 | 83 |
84 void SetCursor(const WebCursor& cursor) override { | 84 void SetCursor(const WebCursor& cursor) override { |
85 cursor_ = cursor; | 85 cursor_ = cursor; |
86 } | 86 } |
87 | 87 |
88 void ShowContextMenuAtPoint(const gfx::Point& point) override {} | 88 void ShowContextMenuAtPoint(const gfx::Point& point, |
| 89 bool from_touch = false) override {} |
89 | 90 |
90 protected: | 91 protected: |
91 TouchEmulator* emulator() const { | 92 TouchEmulator* emulator() const { |
92 return emulator_.get(); | 93 return emulator_.get(); |
93 } | 94 } |
94 | 95 |
95 int modifiers() const { | 96 int modifiers() const { |
96 return (shift_pressed_ ? WebInputEvent::kShiftKey : 0) | | 97 return (shift_pressed_ ? WebInputEvent::kShiftKey : 0) | |
97 (mouse_pressed_ ? WebInputEvent::kLeftButtonDown : 0); | 98 (mouse_pressed_ ? WebInputEvent::kLeftButtonDown : 0); |
98 } | 99 } |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 emulator()->SetDeviceScaleFactor(1.0f); | 589 emulator()->SetDeviceScaleFactor(1.0f); |
589 EXPECT_EQ(1.0f, GetCursorScaleFactor()); | 590 EXPECT_EQ(1.0f, GetCursorScaleFactor()); |
590 | 591 |
591 TouchEmulator another(this, 4.0f); | 592 TouchEmulator another(this, 4.0f); |
592 EXPECT_EQ(1.0f, GetCursorScaleFactor()); | 593 EXPECT_EQ(1.0f, GetCursorScaleFactor()); |
593 another.Enable(ui::GestureProviderConfigType::GENERIC_MOBILE); | 594 another.Enable(ui::GestureProviderConfigType::GENERIC_MOBILE); |
594 EXPECT_EQ(2.0f, GetCursorScaleFactor()); | 595 EXPECT_EQ(2.0f, GetCursorScaleFactor()); |
595 } | 596 } |
596 | 597 |
597 } // namespace content | 598 } // namespace content |
OLD | NEW |