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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 return WebString(); | 472 return WebString(); |
472 } | 473 } |
473 | 474 |
474 const KURL& kurl = url; | 475 const KURL& kurl = url; |
475 DCHECK(kurl.protocolIs("javascript")); | 476 DCHECK(kurl.protocolIs("javascript")); |
476 | 477 |
477 String script = decodeURLEscapeSequences( | 478 String script = decodeURLEscapeSequences( |
478 kurl.getString().substring(strlen("javascript:"))); | 479 kurl.getString().substring(strlen("javascript:"))); |
479 | 480 |
480 UserGestureIndicator gestureIndicator( | 481 UserGestureIndicator gestureIndicator( |
481 popupsAllowed ? UserGestureToken::create(UserGestureToken::NewGesture) | 482 popupsAllowed ? DocumentUserGestureToken::create( |
| 483 frame->document(), UserGestureToken::NewGesture) |
482 : nullptr); | 484 : nullptr); |
483 v8::HandleScope handleScope(toIsolate(frame)); | 485 v8::HandleScope handleScope(toIsolate(frame)); |
484 v8::Local<v8::Value> result = | 486 v8::Local<v8::Value> result = |
485 frame->script().executeScriptInMainWorldAndReturnValue( | 487 frame->script().executeScriptInMainWorldAndReturnValue( |
486 ScriptSourceCode(script)); | 488 ScriptSourceCode(script)); |
487 | 489 |
488 // Failure is reported as a null string. | 490 // Failure is reported as a null string. |
489 if (result.IsEmpty() || !result->IsString()) | 491 if (result.IsEmpty() || !result->IsString()) |
490 return WebString(); | 492 return WebString(); |
491 return toCoreString(v8::Local<v8::String>::Cast(result)); | 493 return toCoreString(v8::Local<v8::String>::Cast(result)); |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 // frame view. | 973 // frame view. |
972 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRect); | 974 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRect); |
973 } | 975 } |
974 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); | 976 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); |
975 // Convert to the plugin position. | 977 // Convert to the plugin position. |
976 for (size_t i = 0; i < cutOutRects.size(); i++) | 978 for (size_t i = 0; i < cutOutRects.size(); i++) |
977 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); | 979 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); |
978 } | 980 } |
979 | 981 |
980 } // namespace blink | 982 } // namespace blink |
OLD | NEW |