| 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 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 return WebDocument(frame()->document()); | 680 return WebDocument(frame()->document()); |
| 681 } | 681 } |
| 682 | 682 |
| 683 WebPerformance WebLocalFrameImpl::performance() const | 683 WebPerformance WebLocalFrameImpl::performance() const |
| 684 { | 684 { |
| 685 if (!frame()) | 685 if (!frame()) |
| 686 return WebPerformance(); | 686 return WebPerformance(); |
| 687 return WebPerformance(DOMWindowPerformance::performance(*(frame()->domWindow
()))); | 687 return WebPerformance(DOMWindowPerformance::performance(*(frame()->domWindow
()))); |
| 688 } | 688 } |
| 689 | 689 |
| 690 bool WebLocalFrameImpl::dispatchBeforeUnloadEvent() | |
| 691 { | |
| 692 if (!frame()) | |
| 693 return true; | |
| 694 return frame()->loader().shouldClose(); | |
| 695 } | |
| 696 | |
| 697 void WebLocalFrameImpl::dispatchUnloadEvent() | 690 void WebLocalFrameImpl::dispatchUnloadEvent() |
| 698 { | 691 { |
| 699 if (!frame()) | 692 if (!frame()) |
| 700 return; | 693 return; |
| 701 SubframeLoadingDisabler disabler(frame()->document()); | 694 SubframeLoadingDisabler disabler(frame()->document()); |
| 702 frame()->loader().dispatchUnloadEvent(); | 695 frame()->loader().dispatchUnloadEvent(); |
| 703 } | 696 } |
| 704 | 697 |
| 705 void WebLocalFrameImpl::executeScript(const WebScriptSource& source) | 698 void WebLocalFrameImpl::executeScript(const WebScriptSource& source) |
| 706 { | 699 { |
| (...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1840 | 1833 |
| 1841 void WebLocalFrameImpl::sendPings(const WebURL& destinationURL) | 1834 void WebLocalFrameImpl::sendPings(const WebURL& destinationURL) |
| 1842 { | 1835 { |
| 1843 DCHECK(frame()); | 1836 DCHECK(frame()); |
| 1844 DCHECK(m_contextMenuNode.get()); | 1837 DCHECK(m_contextMenuNode.get()); |
| 1845 Element* anchor = m_contextMenuNode->enclosingLinkEventParentOrSelf(); | 1838 Element* anchor = m_contextMenuNode->enclosingLinkEventParentOrSelf(); |
| 1846 if (isHTMLAnchorElement(anchor)) | 1839 if (isHTMLAnchorElement(anchor)) |
| 1847 toHTMLAnchorElement(anchor)->sendPings(destinationURL); | 1840 toHTMLAnchorElement(anchor)->sendPings(destinationURL); |
| 1848 } | 1841 } |
| 1849 | 1842 |
| 1843 WebLocalFrame::BeforeUnloadReturnValue WebLocalFrameImpl::dispatchBeforeUnloadEv
ent(bool isReload) |
| 1844 { |
| 1845 if (!frame()) { |
| 1846 return WebLocalFrame::BeforeUnloadReturnValue::DontProceed; |
| 1847 } |
| 1848 |
| 1849 bool proceed = frame()->loader().shouldClose(isReload); |
| 1850 |
| 1851 if (!frame()) { |
| 1852 return WebLocalFrame::BeforeUnloadReturnValue::FrameDestroyed; |
| 1853 } |
| 1854 |
| 1855 return proceed ? WebLocalFrame::BeforeUnloadReturnValue::Proceed : WebLocalF
rame::BeforeUnloadReturnValue::DontProceed; |
| 1856 } |
| 1857 |
| 1850 WebURLRequest WebLocalFrameImpl::requestFromHistoryItem(const WebHistoryItem& it
em, WebCachePolicy cachePolicy) const | 1858 WebURLRequest WebLocalFrameImpl::requestFromHistoryItem(const WebHistoryItem& it
em, WebCachePolicy cachePolicy) const |
| 1851 { | 1859 { |
| 1852 HistoryItem* historyItem = item; | 1860 HistoryItem* historyItem = item; |
| 1853 ResourceRequest request = FrameLoader::resourceRequestFromHistoryItem( | 1861 ResourceRequest request = FrameLoader::resourceRequestFromHistoryItem( |
| 1854 historyItem, cachePolicy); | 1862 historyItem, cachePolicy); |
| 1855 return WrappedResourceRequest(request); | 1863 return WrappedResourceRequest(request); |
| 1856 } | 1864 } |
| 1857 | 1865 |
| 1858 WebURLRequest WebLocalFrameImpl::requestForReload(WebFrameLoadType loadType, | 1866 WebURLRequest WebLocalFrameImpl::requestForReload(WebFrameLoadType loadType, |
| 1859 const WebURL& overrideUrl) const | 1867 const WebURL& overrideUrl) const |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2113 return WebSandboxFlags::None; | 2121 return WebSandboxFlags::None; |
| 2114 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags(
)); | 2122 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags(
)); |
| 2115 } | 2123 } |
| 2116 | 2124 |
| 2117 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags) | 2125 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags) |
| 2118 { | 2126 { |
| 2119 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); | 2127 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); |
| 2120 } | 2128 } |
| 2121 | 2129 |
| 2122 } // namespace blink | 2130 } // namespace blink |
| OLD | NEW |