OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. | 3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 19 matching lines...) Expand all Loading... |
30 */ | 30 */ |
31 | 31 |
32 #include "web/WebPluginContainerImpl.h" | 32 #include "web/WebPluginContainerImpl.h" |
33 | 33 |
34 #include "bindings/core/v8/ScriptController.h" | 34 #include "bindings/core/v8/ScriptController.h" |
35 #include "bindings/core/v8/ScriptSourceCode.h" | 35 #include "bindings/core/v8/ScriptSourceCode.h" |
36 #include "bindings/core/v8/V8Element.h" | 36 #include "bindings/core/v8/V8Element.h" |
37 #include "core/HTMLNames.h" | 37 #include "core/HTMLNames.h" |
38 #include "core/clipboard/DataObject.h" | 38 #include "core/clipboard/DataObject.h" |
39 #include "core/clipboard/DataTransfer.h" | 39 #include "core/clipboard/DataTransfer.h" |
| 40 #include "core/dom/DocumentUserGestureToken.h" |
40 #include "core/dom/ExecutionContext.h" | 41 #include "core/dom/ExecutionContext.h" |
41 #include "core/dom/Fullscreen.h" | 42 #include "core/dom/Fullscreen.h" |
42 #include "core/events/DragEvent.h" | 43 #include "core/events/DragEvent.h" |
43 #include "core/events/EventQueue.h" | 44 #include "core/events/EventQueue.h" |
44 #include "core/events/GestureEvent.h" | 45 #include "core/events/GestureEvent.h" |
45 #include "core/events/KeyboardEvent.h" | 46 #include "core/events/KeyboardEvent.h" |
46 #include "core/events/MouseEvent.h" | 47 #include "core/events/MouseEvent.h" |
47 #include "core/events/ProgressEvent.h" | 48 #include "core/events/ProgressEvent.h" |
48 #include "core/events/ResourceProgressEvent.h" | 49 #include "core/events/ResourceProgressEvent.h" |
49 #include "core/events/TouchEvent.h" | 50 #include "core/events/TouchEvent.h" |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 m_element->document().url(), OrdinalNumber())) | 471 m_element->document().url(), OrdinalNumber())) |
471 return WebString(); | 472 return WebString(); |
472 | 473 |
473 const KURL& kurl = url; | 474 const KURL& kurl = url; |
474 DCHECK(kurl.protocolIs("javascript")); | 475 DCHECK(kurl.protocolIs("javascript")); |
475 | 476 |
476 String script = decodeURLEscapeSequences( | 477 String script = decodeURLEscapeSequences( |
477 kurl.getString().substring(strlen("javascript:"))); | 478 kurl.getString().substring(strlen("javascript:"))); |
478 | 479 |
479 UserGestureIndicator gestureIndicator( | 480 UserGestureIndicator gestureIndicator( |
480 popupsAllowed ? UserGestureToken::create(UserGestureToken::NewGesture) | 481 popupsAllowed ? DocumentUserGestureToken::create( |
| 482 frame->document(), UserGestureToken::NewGesture) |
481 : nullptr); | 483 : nullptr); |
482 v8::HandleScope handleScope(toIsolate(frame)); | 484 v8::HandleScope handleScope(toIsolate(frame)); |
483 v8::Local<v8::Value> result = | 485 v8::Local<v8::Value> result = |
484 frame->script().executeScriptInMainWorldAndReturnValue( | 486 frame->script().executeScriptInMainWorldAndReturnValue( |
485 ScriptSourceCode(script)); | 487 ScriptSourceCode(script)); |
486 | 488 |
487 // Failure is reported as a null string. | 489 // Failure is reported as a null string. |
488 if (result.IsEmpty() || !result->IsString()) | 490 if (result.IsEmpty() || !result->IsString()) |
489 return WebString(); | 491 return WebString(); |
490 return toCoreString(v8::Local<v8::String>::Cast(result)); | 492 return toCoreString(v8::Local<v8::String>::Cast(result)); |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
970 // frame view. | 972 // frame view. |
971 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRect); | 973 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRect); |
972 } | 974 } |
973 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); | 975 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); |
974 // Convert to the plugin position. | 976 // Convert to the plugin position. |
975 for (size_t i = 0; i < cutOutRects.size(); i++) | 977 for (size_t i = 0; i < cutOutRects.size(); i++) |
976 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); | 978 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); |
977 } | 979 } |
978 | 980 |
979 } // namespace blink | 981 } // namespace blink |
OLD | NEW |