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/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 modifiers |= GetKeyModifier(*it); | 114 modifiers |= GetKeyModifier(*it); |
115 } | 115 } |
116 return modifiers; | 116 return modifiers; |
117 } | 117 } |
118 | 118 |
119 int GetKeyModifiersFromV8(v8::Local<v8::Value> value) { | 119 int GetKeyModifiersFromV8(v8::Local<v8::Value> value) { |
120 std::vector<std::string> modifier_names; | 120 std::vector<std::string> modifier_names; |
121 if (value->IsString()) { | 121 if (value->IsString()) { |
122 modifier_names.push_back(gin::V8ToString(value)); | 122 modifier_names.push_back(gin::V8ToString(value)); |
123 } else if (value->IsArray()) { | 123 } else if (value->IsArray()) { |
124 v8::Isolate* isolate = blink::mainThreadIsolate(); | |
124 gin::Converter<std::vector<std::string> >::FromV8( | 125 gin::Converter<std::vector<std::string> >::FromV8( |
125 NULL, value, &modifier_names); | 126 isolate, value, &modifier_names); |
bashi
2015/05/29 08:20:34
This is the only diff from the original CL.
jochen (gone - plz use gerrit)
2015/05/29 11:28:29
can you add the Isolate* as argument to this metho
bashi
2015/06/02 00:12:05
Done.
| |
126 } | 127 } |
127 return GetKeyModifiers(modifier_names); | 128 return GetKeyModifiers(modifier_names); |
128 } | 129 } |
129 | 130 |
130 // Maximum distance (in space and time) for a mouse click to register as a | 131 // Maximum distance (in space and time) for a mouse click to register as a |
131 // double or triple click. | 132 // double or triple click. |
132 const double kMultipleClickTimeSec = 1; | 133 const double kMultipleClickTimeSec = 1; |
133 const int kMultipleClickRadiusPixels = 5; | 134 const int kMultipleClickRadiusPixels = 5; |
134 const char kSubMenuDepthIdentifier[] = "_"; | 135 const char kSubMenuDepthIdentifier[] = "_"; |
135 const char kSubMenuIdentifier[] = " >"; | 136 const char kSubMenuIdentifier[] = " >"; |
(...skipping 2381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2517 | 2518 |
2518 bool EventSender::HandleInputEventOnViewOrPopup(const WebInputEvent& event) { | 2519 bool EventSender::HandleInputEventOnViewOrPopup(const WebInputEvent& event) { |
2519 if (WebPagePopup* popup = view_->pagePopup()) { | 2520 if (WebPagePopup* popup = view_->pagePopup()) { |
2520 if (!WebInputEvent::isKeyboardEventType(event.type)) | 2521 if (!WebInputEvent::isKeyboardEventType(event.type)) |
2521 return popup->handleInputEvent(event); | 2522 return popup->handleInputEvent(event); |
2522 } | 2523 } |
2523 return view_->handleInputEvent(event); | 2524 return view_->handleInputEvent(event); |
2524 } | 2525 } |
2525 | 2526 |
2526 } // namespace content | 2527 } // namespace content |
OLD | NEW |