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 "content/shell/renderer/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/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "content/public/common/page_zoom.h" | 10 #include "content/public/common/page_zoom.h" |
(...skipping 1541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1552 touch_modifiers_ |= mask; | 1552 touch_modifiers_ |= mask; |
1553 else | 1553 else |
1554 touch_modifiers_ &= ~mask; | 1554 touch_modifiers_ &= ~mask; |
1555 } | 1555 } |
1556 | 1556 |
1557 void EventSender::SetTouchCancelable(bool cancelable) { | 1557 void EventSender::SetTouchCancelable(bool cancelable) { |
1558 touch_cancelable_ = cancelable; | 1558 touch_cancelable_ = cancelable; |
1559 } | 1559 } |
1560 | 1560 |
1561 void EventSender::DumpFilenameBeingDragged() { | 1561 void EventSender::DumpFilenameBeingDragged() { |
| 1562 if (current_drag_data_.isNull()) |
| 1563 return; |
| 1564 |
1562 WebString filename; | 1565 WebString filename; |
1563 WebVector<WebDragData::Item> items = current_drag_data_.items(); | 1566 WebVector<WebDragData::Item> items = current_drag_data_.items(); |
1564 for (size_t i = 0; i < items.size(); ++i) { | 1567 for (size_t i = 0; i < items.size(); ++i) { |
1565 if (items[i].storageType == WebDragData::Item::StorageTypeBinaryData) { | 1568 if (items[i].storageType == WebDragData::Item::StorageTypeBinaryData) { |
1566 filename = items[i].title; | 1569 filename = items[i].title; |
1567 break; | 1570 break; |
1568 } | 1571 } |
1569 } | 1572 } |
1570 delegate_->PrintMessage(std::string("Filename being dragged: ") + | 1573 delegate_->PrintMessage(std::string("Filename being dragged: ") + |
1571 filename.utf8().data() + "\n"); | 1574 filename.utf8().data() + "\n"); |
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2337 | 2340 |
2338 bool EventSender::HandleInputEventOnViewOrPopup(const WebInputEvent& event) { | 2341 bool EventSender::HandleInputEventOnViewOrPopup(const WebInputEvent& event) { |
2339 if (WebPagePopup* popup = view_->pagePopup()) { | 2342 if (WebPagePopup* popup = view_->pagePopup()) { |
2340 if (!WebInputEvent::isKeyboardEventType(event.type)) | 2343 if (!WebInputEvent::isKeyboardEventType(event.type)) |
2341 return popup->handleInputEvent(event); | 2344 return popup->handleInputEvent(event); |
2342 } | 2345 } |
2343 return view_->handleInputEvent(event); | 2346 return view_->handleInputEvent(event); |
2344 } | 2347 } |
2345 | 2348 |
2346 } // namespace content | 2349 } // namespace content |
OLD | NEW |