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

Side by Side Diff: components/test_runner/test_plugin.cc

Issue 1463823003: Return a enumeration of the state of handling of InputEvents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/test_runner/test_plugin.h" 5 #include "components/test_runner/test_plugin.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 } 587 }
588 } 588 }
589 if (vertex_shader) 589 if (vertex_shader)
590 context_->deleteShader(vertex_shader); 590 context_->deleteShader(vertex_shader);
591 if (fragment_shader) 591 if (fragment_shader)
592 context_->deleteShader(fragment_shader); 592 context_->deleteShader(fragment_shader);
593 593
594 return program; 594 return program;
595 } 595 }
596 596
597 bool TestPlugin::handleInputEvent(const blink::WebInputEvent& event, 597 blink::WebInputEventResult TestPlugin::handleInputEvent(
598 blink::WebCursorInfo& info) { 598 const blink::WebInputEvent& event,
599 blink::WebCursorInfo& info) {
599 const char* event_name = 0; 600 const char* event_name = 0;
600 switch (event.type) { 601 switch (event.type) {
601 case blink::WebInputEvent::Undefined: 602 case blink::WebInputEvent::Undefined:
602 event_name = "unknown"; 603 event_name = "unknown";
603 break; 604 break;
604 605
605 case blink::WebInputEvent::MouseDown: 606 case blink::WebInputEvent::MouseDown:
606 event_name = "MouseDown"; 607 event_name = "MouseDown";
607 break; 608 break;
608 case blink::WebInputEvent::MouseUp: 609 case blink::WebInputEvent::MouseUp:
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 if (print_event_details_) 714 if (print_event_details_)
714 PrintEventDetails(delegate_, event); 715 PrintEventDetails(delegate_, event);
715 if (print_user_gesture_status_) 716 if (print_user_gesture_status_)
716 delegate_->PrintMessage( 717 delegate_->PrintMessage(
717 std::string("* ") + 718 std::string("* ") +
718 (blink::WebUserGestureIndicator::isProcessingUserGesture() ? "" 719 (blink::WebUserGestureIndicator::isProcessingUserGesture() ? ""
719 : "not ") + 720 : "not ") +
720 "handling user gesture\n"); 721 "handling user gesture\n");
721 if (is_persistent_) 722 if (is_persistent_)
722 delegate_->PrintMessage(std::string("TestPlugin: isPersistent\n")); 723 delegate_->PrintMessage(std::string("TestPlugin: isPersistent\n"));
723 return false; 724 return blink::WebInputEventResult::NotHandled;
724 } 725 }
725 726
726 bool TestPlugin::handleDragStatusUpdate( 727 bool TestPlugin::handleDragStatusUpdate(
727 blink::WebDragStatus drag_status, 728 blink::WebDragStatus drag_status,
728 const blink::WebDragData& data, 729 const blink::WebDragData& data,
729 blink::WebDragOperationsMask mask, 730 blink::WebDragOperationsMask mask,
730 const blink::WebPoint& position, 731 const blink::WebPoint& position,
731 const blink::WebPoint& screen_position) { 732 const blink::WebPoint& screen_position) {
732 const char* drag_status_name = 0; 733 const char* drag_status_name = 0;
733 switch (drag_status) { 734 switch (drag_status) {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 return kPluginPersistsMimeType; 780 return kPluginPersistsMimeType;
780 } 781 }
781 782
782 bool TestPlugin::IsSupportedMimeType(const blink::WebString& mime_type) { 783 bool TestPlugin::IsSupportedMimeType(const blink::WebString& mime_type) {
783 return mime_type == TestPlugin::MimeType() || 784 return mime_type == TestPlugin::MimeType() ||
784 mime_type == PluginPersistsMimeType() || 785 mime_type == PluginPersistsMimeType() ||
785 mime_type == CanCreateWithoutRendererMimeType(); 786 mime_type == CanCreateWithoutRendererMimeType();
786 } 787 }
787 788
788 } // namespace test_runner 789 } // namespace test_runner
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698