| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <tuple> | 10 #include <tuple> |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 // RendererFrameManager singleton survives and and the MessageLoop gets | 576 // RendererFrameManager singleton survives and and the MessageLoop gets |
| 577 // destroyed. The correct fix would be to have base::ObserverListThreadSafe | 577 // destroyed. The correct fix would be to have base::ObserverListThreadSafe |
| 578 // look | 578 // look |
| 579 // up the proper message loop every time (see crbug.com/443824.) | 579 // up the proper message loop every time (see crbug.com/443824.) |
| 580 RendererFrameManager::GetInstance()->OnMemoryPressure(level); | 580 RendererFrameManager::GetInstance()->OnMemoryPressure(level); |
| 581 } | 581 } |
| 582 | 582 |
| 583 void SendInputEventACK(WebInputEvent::Type type, | 583 void SendInputEventACK(WebInputEvent::Type type, |
| 584 InputEventAckState ack_result) { | 584 InputEventAckState ack_result) { |
| 585 DCHECK(!WebInputEvent::isTouchEventType(type)); | 585 DCHECK(!WebInputEvent::isTouchEventType(type)); |
| 586 InputEventAck ack(type, ack_result); | 586 InputEventAck ack( |
| 587 InputEventAckLocation::INPUT_EVENT_ACK_LOCATION_COMPOSITOR_THREAD, type, |
| 588 ack_result); |
| 587 InputHostMsg_HandleInputEvent_ACK response(0, ack); | 589 InputHostMsg_HandleInputEvent_ACK response(0, ack); |
| 588 widget_host_->OnMessageReceived(response); | 590 widget_host_->OnMessageReceived(response); |
| 589 } | 591 } |
| 590 | 592 |
| 591 void SendTouchEventACK(WebInputEvent::Type type, | 593 void SendTouchEventACK(WebInputEvent::Type type, |
| 592 InputEventAckState ack_result, | 594 InputEventAckState ack_result, |
| 593 uint32_t event_id) { | 595 uint32_t event_id) { |
| 594 DCHECK(WebInputEvent::isTouchEventType(type)); | 596 DCHECK(WebInputEvent::isTouchEventType(type)); |
| 595 InputEventAck ack(type, ack_result, event_id); | 597 InputEventAck ack( |
| 598 InputEventAckLocation::INPUT_EVENT_ACK_LOCATION_COMPOSITOR_THREAD, type, |
| 599 ack_result, event_id); |
| 596 InputHostMsg_HandleInputEvent_ACK response(0, ack); | 600 InputHostMsg_HandleInputEvent_ACK response(0, ack); |
| 597 widget_host_->OnMessageReceived(response); | 601 widget_host_->OnMessageReceived(response); |
| 598 } | 602 } |
| 599 | 603 |
| 600 size_t GetSentMessageCountAndResetSink() { | 604 size_t GetSentMessageCountAndResetSink() { |
| 601 size_t count = sink_->message_count(); | 605 size_t count = sink_->message_count(); |
| 602 sink_->ClearMessages(); | 606 sink_->ClearMessages(); |
| 603 return count; | 607 return count; |
| 604 } | 608 } |
| 605 | 609 |
| (...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1335 | 1339 |
| 1336 // Now start a touch event, and remove the event-handlers before the release. | 1340 // Now start a touch event, and remove the event-handlers before the release. |
| 1337 view_->OnTouchEvent(&press); | 1341 view_->OnTouchEvent(&press); |
| 1338 EXPECT_TRUE(press.synchronous_handling_disabled()); | 1342 EXPECT_TRUE(press.synchronous_handling_disabled()); |
| 1339 EXPECT_EQ(ui::MotionEvent::ACTION_DOWN, pointer_state().GetAction()); | 1343 EXPECT_EQ(ui::MotionEvent::ACTION_DOWN, pointer_state().GetAction()); |
| 1340 EXPECT_EQ(1U, pointer_state().GetPointerCount()); | 1344 EXPECT_EQ(1U, pointer_state().GetPointerCount()); |
| 1341 | 1345 |
| 1342 widget_host_->OnMessageReceived(ViewHostMsg_HasTouchEventHandlers(0, false)); | 1346 widget_host_->OnMessageReceived(ViewHostMsg_HasTouchEventHandlers(0, false)); |
| 1343 | 1347 |
| 1344 // Ack'ing the outstanding event should flush the pending touch queue. | 1348 // Ack'ing the outstanding event should flush the pending touch queue. |
| 1345 InputEventAck ack(blink::WebInputEvent::TouchStart, | 1349 InputEventAck ack( |
| 1346 INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS, | 1350 InputEventAckLocation::INPUT_EVENT_ACK_LOCATION_COMPOSITOR_THREAD, |
| 1347 press.unique_event_id()); | 1351 blink::WebInputEvent::TouchStart, |
| 1352 INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS, press.unique_event_id()); |
| 1348 widget_host_->OnMessageReceived(InputHostMsg_HandleInputEvent_ACK(0, ack)); | 1353 widget_host_->OnMessageReceived(InputHostMsg_HandleInputEvent_ACK(0, ack)); |
| 1349 EXPECT_EQ(0U, GetSentMessageCountAndResetSink()); | 1354 EXPECT_EQ(0U, GetSentMessageCountAndResetSink()); |
| 1350 | 1355 |
| 1351 ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(20, 20), 0, | 1356 ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(20, 20), 0, |
| 1352 base::TimeTicks::Now()); | 1357 base::TimeTicks::Now()); |
| 1353 view_->OnTouchEvent(&move2); | 1358 view_->OnTouchEvent(&move2); |
| 1354 EXPECT_TRUE(press.synchronous_handling_disabled()); | 1359 EXPECT_TRUE(press.synchronous_handling_disabled()); |
| 1355 EXPECT_EQ(ui::MotionEvent::ACTION_MOVE, pointer_state().GetAction()); | 1360 EXPECT_EQ(ui::MotionEvent::ACTION_MOVE, pointer_state().GetAction()); |
| 1356 EXPECT_EQ(1U, pointer_state().GetPointerCount()); | 1361 EXPECT_EQ(1U, pointer_state().GetPointerCount()); |
| 1357 | 1362 |
| (...skipping 3331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4689 | 4694 |
| 4690 // Retrieve the selected text from clipboard and verify it is as expected. | 4695 // Retrieve the selected text from clipboard and verify it is as expected. |
| 4691 base::string16 result_text; | 4696 base::string16 result_text; |
| 4692 clipboard->ReadText(ui::CLIPBOARD_TYPE_SELECTION, &result_text); | 4697 clipboard->ReadText(ui::CLIPBOARD_TYPE_SELECTION, &result_text); |
| 4693 EXPECT_EQ(expected_text, result_text); | 4698 EXPECT_EQ(expected_text, result_text); |
| 4694 } | 4699 } |
| 4695 } | 4700 } |
| 4696 #endif | 4701 #endif |
| 4697 | 4702 |
| 4698 } // namespace content | 4703 } // namespace content |
| OLD | NEW |