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 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 } | 704 } |
705 | 705 |
706 void WebLocalFrameImpl::dispatchUnloadEvent() | 706 void WebLocalFrameImpl::dispatchUnloadEvent() |
707 { | 707 { |
708 if (!frame()) | 708 if (!frame()) |
709 return; | 709 return; |
710 SubframeLoadingDisabler disabler(frame()->document()); | 710 SubframeLoadingDisabler disabler(frame()->document()); |
711 frame()->loader().dispatchUnloadEvent(); | 711 frame()->loader().dispatchUnloadEvent(); |
712 } | 712 } |
713 | 713 |
714 NPObject* WebLocalFrameImpl::windowObject() const | |
715 { | |
716 if (!frame() || ScriptForbiddenScope::isScriptForbidden()) | |
717 return 0; | |
718 return frame()->script().windowScriptNPObject(); | |
719 } | |
720 | |
721 void WebLocalFrameImpl::bindToWindowObject(const WebString& name, NPObject* obje
ct) | |
722 { | |
723 bindToWindowObject(name, object, 0); | |
724 } | |
725 | |
726 void WebLocalFrameImpl::bindToWindowObject(const WebString& name, NPObject* obje
ct, void*) | |
727 { | |
728 if (!frame() || !frame()->script().canExecuteScripts(NotAboutToExecuteScript
)) | |
729 return; | |
730 frame()->script().bindToWindowObject(frame(), String(name), object); | |
731 } | |
732 | |
733 void WebLocalFrameImpl::executeScript(const WebScriptSource& source) | 714 void WebLocalFrameImpl::executeScript(const WebScriptSource& source) |
734 { | 715 { |
735 ASSERT(frame()); | 716 ASSERT(frame()); |
736 TextPosition position(OrdinalNumber::fromOneBasedInt(source.startLine), Ordi
nalNumber::first()); | 717 TextPosition position(OrdinalNumber::fromOneBasedInt(source.startLine), Ordi
nalNumber::first()); |
737 v8::HandleScope handleScope(toIsolate(frame())); | 718 v8::HandleScope handleScope(toIsolate(frame())); |
738 frame()->script().executeScriptInMainWorld(ScriptSourceCode(source.code, sou
rce.url, position)); | 719 frame()->script().executeScriptInMainWorld(ScriptSourceCode(source.code, sou
rce.url, position)); |
739 } | 720 } |
740 | 721 |
741 void WebLocalFrameImpl::executeScriptInIsolatedWorld(int worldID, const WebScrip
tSource* sourcesIn, unsigned numSources, int extensionGroup) | 722 void WebLocalFrameImpl::executeScriptInIsolatedWorld(int worldID, const WebScrip
tSource* sourcesIn, unsigned numSources, int extensionGroup) |
742 { | 723 { |
(...skipping 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2189 return WebSandboxFlags::None; | 2170 return WebSandboxFlags::None; |
2190 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags(
)); | 2171 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags(
)); |
2191 } | 2172 } |
2192 | 2173 |
2193 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags) | 2174 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags) |
2194 { | 2175 { |
2195 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); | 2176 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); |
2196 } | 2177 } |
2197 | 2178 |
2198 } // namespace blink | 2179 } // namespace blink |
OLD | NEW |