| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 | 414 |
| 415 void WebPluginContainerImpl::allowScriptObjects() | 415 void WebPluginContainerImpl::allowScriptObjects() |
| 416 { | 416 { |
| 417 } | 417 } |
| 418 | 418 |
| 419 void WebPluginContainerImpl::clearScriptObjects() | 419 void WebPluginContainerImpl::clearScriptObjects() |
| 420 { | 420 { |
| 421 Frame* frame = m_element->document().frame(); | 421 Frame* frame = m_element->document().frame(); |
| 422 if (!frame) | 422 if (!frame) |
| 423 return; | 423 return; |
| 424 frame->script()->cleanupScriptObjectsForPlugin(this); | 424 frame->script().cleanupScriptObjectsForPlugin(this); |
| 425 } | 425 } |
| 426 | 426 |
| 427 NPObject* WebPluginContainerImpl::scriptableObjectForElement() | 427 NPObject* WebPluginContainerImpl::scriptableObjectForElement() |
| 428 { | 428 { |
| 429 return m_element->getNPObject(); | 429 return m_element->getNPObject(); |
| 430 } | 430 } |
| 431 | 431 |
| 432 WebString WebPluginContainerImpl::executeScriptURL(const WebURL& url, bool popup
sAllowed) | 432 WebString WebPluginContainerImpl::executeScriptURL(const WebURL& url, bool popup
sAllowed) |
| 433 { | 433 { |
| 434 Frame* frame = m_element->document().frame(); | 434 Frame* frame = m_element->document().frame(); |
| 435 if (!frame) | 435 if (!frame) |
| 436 return WebString(); | 436 return WebString(); |
| 437 | 437 |
| 438 const KURL& kurl = url; | 438 const KURL& kurl = url; |
| 439 ASSERT(kurl.protocolIs("javascript")); | 439 ASSERT(kurl.protocolIs("javascript")); |
| 440 | 440 |
| 441 String script = decodeURLEscapeSequences( | 441 String script = decodeURLEscapeSequences( |
| 442 kurl.string().substring(strlen("javascript:"))); | 442 kurl.string().substring(strlen("javascript:"))); |
| 443 | 443 |
| 444 UserGestureIndicator gestureIndicator(popupsAllowed ? DefinitelyProcessingNe
wUserGesture : PossiblyProcessingUserGesture); | 444 UserGestureIndicator gestureIndicator(popupsAllowed ? DefinitelyProcessingNe
wUserGesture : PossiblyProcessingUserGesture); |
| 445 ScriptValue result = frame->script()->executeScriptInMainWorldAndReturnValue
(ScriptSourceCode(script)); | 445 ScriptValue result = frame->script().executeScriptInMainWorldAndReturnValue(
ScriptSourceCode(script)); |
| 446 | 446 |
| 447 // Failure is reported as a null string. | 447 // Failure is reported as a null string. |
| 448 String resultStr; | 448 String resultStr; |
| 449 result.getString(resultStr); | 449 result.getString(resultStr); |
| 450 return resultStr; | 450 return resultStr; |
| 451 } | 451 } |
| 452 | 452 |
| 453 void WebPluginContainerImpl::loadFrameRequest(const WebURLRequest& request, cons
t WebString& target, bool notifyNeeded, void* notifyData) | 453 void WebPluginContainerImpl::loadFrameRequest(const WebURLRequest& request, cons
t WebString& target, bool notifyNeeded, void* notifyData) |
| 454 { | 454 { |
| 455 Frame* frame = m_element->document().frame(); | 455 Frame* frame = m_element->document().frame(); |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 891 // Take our element and get the clip rect from the enclosing layer and | 891 // Take our element and get the clip rect from the enclosing layer and |
| 892 // frame view. | 892 // frame view. |
| 893 clipRect.intersect( | 893 clipRect.intersect( |
| 894 m_element->document().view()->windowClipRectForFrameOwner(m_element,
true)); | 894 m_element->document().view()->windowClipRectForFrameOwner(m_element,
true)); |
| 895 } | 895 } |
| 896 | 896 |
| 897 return clipRect; | 897 return clipRect; |
| 898 } | 898 } |
| 899 | 899 |
| 900 } // namespace WebKit | 900 } // namespace WebKit |
| OLD | NEW |