Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(696)

Side by Side Diff: content/shell/renderer/test_runner/event_sender.cc

Issue 857303004: Don't crash DRT if dumpFilenameBeingDragged() is called outside a drag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698