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/shell/renderer/test_runner/event_sender.h" | 5 #include "components/test_runner/event_sender.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
11 #include "content/shell/renderer/test_runner/mock_spell_check.h" | 11 #include "components/test_runner/mock_spell_check.h" |
12 #include "content/shell/renderer/test_runner/test_interfaces.h" | 12 #include "components/test_runner/test_interfaces.h" |
13 #include "content/shell/renderer/test_runner/web_test_delegate.h" | 13 #include "components/test_runner/web_test_delegate.h" |
14 #include "content/shell/renderer/test_runner/web_test_proxy.h" | 14 #include "components/test_runner/web_test_proxy.h" |
15 #include "gin/handle.h" | 15 #include "gin/handle.h" |
16 #include "gin/object_template_builder.h" | 16 #include "gin/object_template_builder.h" |
17 #include "gin/wrappable.h" | 17 #include "gin/wrappable.h" |
18 #include "third_party/WebKit/public/platform/WebString.h" | 18 #include "third_party/WebKit/public/platform/WebString.h" |
19 #include "third_party/WebKit/public/platform/WebVector.h" | 19 #include "third_party/WebKit/public/platform/WebVector.h" |
20 #include "third_party/WebKit/public/web/WebContextMenuData.h" | 20 #include "third_party/WebKit/public/web/WebContextMenuData.h" |
21 #include "third_party/WebKit/public/web/WebFrame.h" | 21 #include "third_party/WebKit/public/web/WebFrame.h" |
22 #include "third_party/WebKit/public/web/WebKit.h" | 22 #include "third_party/WebKit/public/web/WebKit.h" |
23 #include "third_party/WebKit/public/web/WebPagePopup.h" | 23 #include "third_party/WebKit/public/web/WebPagePopup.h" |
24 #include "third_party/WebKit/public/web/WebView.h" | 24 #include "third_party/WebKit/public/web/WebView.h" |
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 if (sender_) | 652 if (sender_) |
653 sender_->ClearTouchPoints(); | 653 sender_->ClearTouchPoints(); |
654 } | 654 } |
655 | 655 |
656 void EventSenderBindings::ReleaseTouchPoint(unsigned index) { | 656 void EventSenderBindings::ReleaseTouchPoint(unsigned index) { |
657 if (sender_) | 657 if (sender_) |
658 sender_->ReleaseTouchPoint(index); | 658 sender_->ReleaseTouchPoint(index); |
659 } | 659 } |
660 | 660 |
661 void EventSenderBindings::UpdateTouchPoint(unsigned index, double x, double y) { | 661 void EventSenderBindings::UpdateTouchPoint(unsigned index, double x, double y) { |
662 if (sender_) | 662 if (sender_) { |
663 sender_->UpdateTouchPoint(index, static_cast<float>(x), static_cast<float>(y
)); | 663 sender_->UpdateTouchPoint(index, static_cast<float>(x), |
| 664 static_cast<float>(y)); |
| 665 } |
664 } | 666 } |
665 | 667 |
666 void EventSenderBindings::CancelTouchPoint(unsigned index) { | 668 void EventSenderBindings::CancelTouchPoint(unsigned index) { |
667 if (sender_) | 669 if (sender_) |
668 sender_->CancelTouchPoint(index); | 670 sender_->CancelTouchPoint(index); |
669 } | 671 } |
670 | 672 |
671 void EventSenderBindings::SetTouchModifier(const std::string& key_name, | 673 void EventSenderBindings::SetTouchModifier(const std::string& key_name, |
672 bool set_mask) { | 674 bool set_mask) { |
673 if (sender_) | 675 if (sender_) |
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1483 last_mouse_pos_, | 1485 last_mouse_pos_, |
1484 GetCurrentEventTimeSec(), | 1486 GetCurrentEventTimeSec(), |
1485 click_count_, | 1487 click_count_, |
1486 0, | 1488 0, |
1487 &event); | 1489 &event); |
1488 HandleInputEventOnViewOrPopup(event); | 1490 HandleInputEventOnViewOrPopup(event); |
1489 | 1491 |
1490 pressed_button_= WebMouseEvent::ButtonNone; | 1492 pressed_button_= WebMouseEvent::ButtonNone; |
1491 #endif | 1493 #endif |
1492 | 1494 |
1493 std::vector<std::string> menu_items = MakeMenuItemStringsFor(last_context_menu
_data_.get(), delegate_); | 1495 std::vector<std::string> menu_items = |
| 1496 MakeMenuItemStringsFor(last_context_menu_data_.get(), delegate_); |
1494 last_context_menu_data_.reset(); | 1497 last_context_menu_data_.reset(); |
1495 return menu_items; | 1498 return menu_items; |
1496 } | 1499 } |
1497 | 1500 |
1498 void EventSender::TextZoomIn() { | 1501 void EventSender::TextZoomIn() { |
1499 view_->setTextZoomFactor(view_->textZoomFactor() * 1.2f); | 1502 view_->setTextZoomFactor(view_->textZoomFactor() * 1.2f); |
1500 } | 1503 } |
1501 | 1504 |
1502 void EventSender::TextZoomOut() { | 1505 void EventSender::TextZoomOut() { |
1503 view_->setTextZoomFactor(view_->textZoomFactor() / 1.2f); | 1506 view_->setTextZoomFactor(view_->textZoomFactor() / 1.2f); |
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2471 | 2474 |
2472 bool EventSender::HandleInputEventOnViewOrPopup(const WebInputEvent& event) { | 2475 bool EventSender::HandleInputEventOnViewOrPopup(const WebInputEvent& event) { |
2473 if (WebPagePopup* popup = view_->pagePopup()) { | 2476 if (WebPagePopup* popup = view_->pagePopup()) { |
2474 if (!WebInputEvent::isKeyboardEventType(event.type)) | 2477 if (!WebInputEvent::isKeyboardEventType(event.type)) |
2475 return popup->handleInputEvent(event); | 2478 return popup->handleInputEvent(event); |
2476 } | 2479 } |
2477 return view_->handleInputEvent(event); | 2480 return view_->handleInputEvent(event); |
2478 } | 2481 } |
2479 | 2482 |
2480 } // namespace content | 2483 } // namespace content |
OLD | NEW |