OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ash/shell.h" | 5 #include "ash/shell.h" |
6 #include "base/strings/string_number_conversions.h" | 6 #include "base/strings/string_number_conversions.h" |
7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/chromeos/input_method/textinput_test_helper.h" | 9 #include "chrome/browser/chromeos/input_method/textinput_test_helper.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 std::string coordinate; | 187 std::string coordinate; |
188 if (!content::ExecuteScriptAndExtractString( | 188 if (!content::ExecuteScriptAndExtractString( |
189 tab, | 189 tab, |
190 "textinput_helper.retrieveElementCoordinate('" + id + "')", | 190 "textinput_helper.retrieveElementCoordinate('" + id + "')", |
191 &coordinate)) | 191 &coordinate)) |
192 return false; | 192 return false; |
193 gfx::Rect rect; | 193 gfx::Rect rect; |
194 if (!ConvertRectFromString(coordinate, &rect)) | 194 if (!ConvertRectFromString(coordinate, &rect)) |
195 return false; | 195 return false; |
196 | 196 |
197 WebKit::WebMouseEvent mouse_event; | 197 blink::WebMouseEvent mouse_event; |
198 mouse_event.type = WebKit::WebInputEvent::MouseDown; | 198 mouse_event.type = blink::WebInputEvent::MouseDown; |
199 mouse_event.button = WebKit::WebMouseEvent::ButtonLeft; | 199 mouse_event.button = blink::WebMouseEvent::ButtonLeft; |
200 mouse_event.x = rect.CenterPoint().x(); | 200 mouse_event.x = rect.CenterPoint().x(); |
201 mouse_event.y = rect.CenterPoint().y(); | 201 mouse_event.y = rect.CenterPoint().y(); |
202 mouse_event.clickCount = 1; | 202 mouse_event.clickCount = 1; |
203 tab->GetRenderViewHost()->ForwardMouseEvent(mouse_event); | 203 tab->GetRenderViewHost()->ForwardMouseEvent(mouse_event); |
204 | 204 |
205 mouse_event.type = WebKit::WebInputEvent::MouseUp; | 205 mouse_event.type = blink::WebInputEvent::MouseUp; |
206 tab->GetRenderViewHost()->ForwardMouseEvent(mouse_event); | 206 tab->GetRenderViewHost()->ForwardMouseEvent(mouse_event); |
207 return true; | 207 return true; |
208 } | 208 } |
209 | 209 |
210 } // namespace chromeos | 210 } // namespace chromeos |
OLD | NEW |