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 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 return frame()->loader().shouldClose(); | 774 return frame()->loader().shouldClose(); |
775 } | 775 } |
776 | 776 |
777 void WebLocalFrameImpl::dispatchUnloadEvent() | 777 void WebLocalFrameImpl::dispatchUnloadEvent() |
778 { | 778 { |
779 if (!frame()) | 779 if (!frame()) |
780 return; | 780 return; |
781 frame()->loader().dispatchUnloadEvent(); | 781 frame()->loader().dispatchUnloadEvent(); |
782 } | 782 } |
783 | 783 |
784 NPObject* WebLocalFrameImpl::windowObject() const | |
785 { | |
786 if (!frame() || ScriptForbiddenScope::isScriptForbidden()) | |
787 return 0; | |
788 return frame()->script().windowScriptNPObject(); | |
789 } | |
790 | |
791 void WebLocalFrameImpl::bindToWindowObject(const WebString& name, NPObject* obje
ct) | |
792 { | |
793 bindToWindowObject(name, object, 0); | |
794 } | |
795 | |
796 void WebLocalFrameImpl::bindToWindowObject(const WebString& name, NPObject* obje
ct, void*) | |
797 { | |
798 if (!frame() || !frame()->script().canExecuteScripts(NotAboutToExecuteScript
)) | |
799 return; | |
800 frame()->script().bindToWindowObject(frame(), String(name), object); | |
801 } | |
802 | |
803 void WebLocalFrameImpl::executeScript(const WebScriptSource& source) | 784 void WebLocalFrameImpl::executeScript(const WebScriptSource& source) |
804 { | 785 { |
805 ASSERT(frame()); | 786 ASSERT(frame()); |
806 TextPosition position(OrdinalNumber::fromOneBasedInt(source.startLine), Ordi
nalNumber::first()); | 787 TextPosition position(OrdinalNumber::fromOneBasedInt(source.startLine), Ordi
nalNumber::first()); |
807 v8::HandleScope handleScope(toIsolate(frame())); | 788 v8::HandleScope handleScope(toIsolate(frame())); |
808 frame()->script().executeScriptInMainWorld(ScriptSourceCode(source.code, sou
rce.url, position)); | 789 frame()->script().executeScriptInMainWorld(ScriptSourceCode(source.code, sou
rce.url, position)); |
809 } | 790 } |
810 | 791 |
811 void WebLocalFrameImpl::executeScriptInIsolatedWorld(int worldID, const WebScrip
tSource* sourcesIn, unsigned numSources, int extensionGroup) | 792 void WebLocalFrameImpl::executeScriptInIsolatedWorld(int worldID, const WebScrip
tSource* sourcesIn, unsigned numSources, int extensionGroup) |
812 { | 793 { |
(...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2261 } | 2242 } |
2262 | 2243 |
2263 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const | 2244 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const |
2264 { | 2245 { |
2265 if (!frame()) | 2246 if (!frame()) |
2266 return WebSandboxFlags::None; | 2247 return WebSandboxFlags::None; |
2267 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags(
)); | 2248 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags(
)); |
2268 } | 2249 } |
2269 | 2250 |
2270 } // namespace blink | 2251 } // namespace blink |
OLD | NEW |