| 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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 | 544 |
| 545 long long WebFrameImpl::embedderIdentifier() const | 545 long long WebFrameImpl::embedderIdentifier() const |
| 546 { | 546 { |
| 547 return m_embedderIdentifier; | 547 return m_embedderIdentifier; |
| 548 } | 548 } |
| 549 | 549 |
| 550 WebVector<WebIconURL> WebFrameImpl::iconURLs(int iconTypesMask) const | 550 WebVector<WebIconURL> WebFrameImpl::iconURLs(int iconTypesMask) const |
| 551 { | 551 { |
| 552 // The URL to the icon may be in the header. As such, only | 552 // The URL to the icon may be in the header. As such, only |
| 553 // ask the loader for the icon if it's finished loading. | 553 // ask the loader for the icon if it's finished loading. |
| 554 if (frame()->loader()->state() == FrameStateComplete) | 554 if (frame()->loader().state() == FrameStateComplete) |
| 555 return frame()->loader()->icon()->urlsForTypes(iconTypesMask); | 555 return frame()->loader().icon()->urlsForTypes(iconTypesMask); |
| 556 return WebVector<WebIconURL>(); | 556 return WebVector<WebIconURL>(); |
| 557 } | 557 } |
| 558 | 558 |
| 559 WebSize WebFrameImpl::scrollOffset() const | 559 WebSize WebFrameImpl::scrollOffset() const |
| 560 { | 560 { |
| 561 FrameView* view = frameView(); | 561 FrameView* view = frameView(); |
| 562 if (!view) | 562 if (!view) |
| 563 return WebSize(); | 563 return WebSize(); |
| 564 return view->scrollOffset(); | 564 return view->scrollOffset(); |
| 565 } | 565 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 | 613 |
| 614 WebView* WebFrameImpl::view() const | 614 WebView* WebFrameImpl::view() const |
| 615 { | 615 { |
| 616 return viewImpl(); | 616 return viewImpl(); |
| 617 } | 617 } |
| 618 | 618 |
| 619 WebFrame* WebFrameImpl::opener() const | 619 WebFrame* WebFrameImpl::opener() const |
| 620 { | 620 { |
| 621 if (!frame()) | 621 if (!frame()) |
| 622 return 0; | 622 return 0; |
| 623 return fromFrame(frame()->loader()->opener()); | 623 return fromFrame(frame()->loader().opener()); |
| 624 } | 624 } |
| 625 | 625 |
| 626 void WebFrameImpl::setOpener(const WebFrame* webFrame) | 626 void WebFrameImpl::setOpener(const WebFrame* webFrame) |
| 627 { | 627 { |
| 628 frame()->loader()->setOpener(webFrame ? toWebFrameImpl(webFrame)->frame() :
0); | 628 frame()->loader().setOpener(webFrame ? toWebFrameImpl(webFrame)->frame() : 0
); |
| 629 } | 629 } |
| 630 | 630 |
| 631 WebFrame* WebFrameImpl::parent() const | 631 WebFrame* WebFrameImpl::parent() const |
| 632 { | 632 { |
| 633 if (!frame()) | 633 if (!frame()) |
| 634 return 0; | 634 return 0; |
| 635 return fromFrame(frame()->tree().parent()); | 635 return fromFrame(frame()->tree().parent()); |
| 636 } | 636 } |
| 637 | 637 |
| 638 WebFrame* WebFrameImpl::top() const | 638 WebFrame* WebFrameImpl::top() const |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 if (!frame()) | 806 if (!frame()) |
| 807 return; | 807 return; |
| 808 if (!frame()->settings()->isScriptEnabled()) | 808 if (!frame()->settings()->isScriptEnabled()) |
| 809 return; | 809 return; |
| 810 V8GCController::collectGarbage(v8::Isolate::GetCurrent()); | 810 V8GCController::collectGarbage(v8::Isolate::GetCurrent()); |
| 811 } | 811 } |
| 812 | 812 |
| 813 bool WebFrameImpl::checkIfRunInsecureContent(const WebURL& url) const | 813 bool WebFrameImpl::checkIfRunInsecureContent(const WebURL& url) const |
| 814 { | 814 { |
| 815 ASSERT(frame()); | 815 ASSERT(frame()); |
| 816 return frame()->loader()->mixedContentChecker()->canRunInsecureContent(frame
()->document()->securityOrigin(), url); | 816 return frame()->loader().mixedContentChecker()->canRunInsecureContent(frame(
)->document()->securityOrigin(), url); |
| 817 } | 817 } |
| 818 | 818 |
| 819 v8::Handle<v8::Value> WebFrameImpl::executeScriptAndReturnValue(const WebScriptS
ource& source) | 819 v8::Handle<v8::Value> WebFrameImpl::executeScriptAndReturnValue(const WebScriptS
ource& source) |
| 820 { | 820 { |
| 821 ASSERT(frame()); | 821 ASSERT(frame()); |
| 822 | 822 |
| 823 // FIXME: This fake user gesture is required to make a bunch of pyauto | 823 // FIXME: This fake user gesture is required to make a bunch of pyauto |
| 824 // tests pass. If this isn't needed in non-test situations, we should | 824 // tests pass. If this isn't needed in non-test situations, we should |
| 825 // consider removing this code and changing the tests. | 825 // consider removing this code and changing the tests. |
| 826 // http://code.google.com/p/chromium/issues/detail?id=86397 | 826 // http://code.google.com/p/chromium/issues/detail?id=86397 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 888 | 888 |
| 889 RefPtr<DOMFileSystemBase> fileSystem = DOMFileSystem::create(frame()->docume
nt(), fileSystemName, static_cast<WebCore::FileSystemType>(type), KURL(ParsedURL
String, fileSystemPath.utf8().data())); | 889 RefPtr<DOMFileSystemBase> fileSystem = DOMFileSystem::create(frame()->docume
nt(), fileSystemName, static_cast<WebCore::FileSystemType>(type), KURL(ParsedURL
String, fileSystemPath.utf8().data())); |
| 890 if (isDirectory) | 890 if (isDirectory) |
| 891 return toV8(DirectoryEntry::create(fileSystem, filePath), v8::Handle<v8:
:Object>(), toIsolate(frame())); | 891 return toV8(DirectoryEntry::create(fileSystem, filePath), v8::Handle<v8:
:Object>(), toIsolate(frame())); |
| 892 return toV8(FileEntry::create(fileSystem, filePath), v8::Handle<v8::Object>(
), toIsolate(frame())); | 892 return toV8(FileEntry::create(fileSystem, filePath), v8::Handle<v8::Object>(
), toIsolate(frame())); |
| 893 } | 893 } |
| 894 | 894 |
| 895 void WebFrameImpl::reload(bool ignoreCache) | 895 void WebFrameImpl::reload(bool ignoreCache) |
| 896 { | 896 { |
| 897 ASSERT(frame()); | 897 ASSERT(frame()); |
| 898 frame()->loader()->reload(ignoreCache ? EndToEndReload : NormalReload); | 898 frame()->loader().reload(ignoreCache ? EndToEndReload : NormalReload); |
| 899 } | 899 } |
| 900 | 900 |
| 901 void WebFrameImpl::reloadWithOverrideURL(const WebURL& overrideUrl, bool ignoreC
ache) | 901 void WebFrameImpl::reloadWithOverrideURL(const WebURL& overrideUrl, bool ignoreC
ache) |
| 902 { | 902 { |
| 903 ASSERT(frame()); | 903 ASSERT(frame()); |
| 904 frame()->loader()->reload(ignoreCache ? EndToEndReload : NormalReload, overr
ideUrl); | 904 frame()->loader().reload(ignoreCache ? EndToEndReload : NormalReload, overri
deUrl); |
| 905 } | 905 } |
| 906 | 906 |
| 907 void WebFrameImpl::loadRequest(const WebURLRequest& request) | 907 void WebFrameImpl::loadRequest(const WebURLRequest& request) |
| 908 { | 908 { |
| 909 ASSERT(frame()); | 909 ASSERT(frame()); |
| 910 ASSERT(!request.isNull()); | 910 ASSERT(!request.isNull()); |
| 911 const ResourceRequest& resourceRequest = request.toResourceRequest(); | 911 const ResourceRequest& resourceRequest = request.toResourceRequest(); |
| 912 | 912 |
| 913 if (resourceRequest.url().protocolIs("javascript")) { | 913 if (resourceRequest.url().protocolIs("javascript")) { |
| 914 loadJavaScriptURL(resourceRequest.url()); | 914 loadJavaScriptURL(resourceRequest.url()); |
| 915 return; | 915 return; |
| 916 } | 916 } |
| 917 | 917 |
| 918 frame()->loader()->load(FrameLoadRequest(0, resourceRequest)); | 918 frame()->loader().load(FrameLoadRequest(0, resourceRequest)); |
| 919 } | 919 } |
| 920 | 920 |
| 921 void WebFrameImpl::loadHistoryItem(const WebHistoryItem& item) | 921 void WebFrameImpl::loadHistoryItem(const WebHistoryItem& item) |
| 922 { | 922 { |
| 923 ASSERT(frame()); | 923 ASSERT(frame()); |
| 924 RefPtr<HistoryItem> historyItem = PassRefPtr<HistoryItem>(item); | 924 RefPtr<HistoryItem> historyItem = PassRefPtr<HistoryItem>(item); |
| 925 ASSERT(historyItem); | 925 ASSERT(historyItem); |
| 926 | 926 |
| 927 frame()->loader()->prepareForHistoryNavigation(); | 927 frame()->loader().prepareForHistoryNavigation(); |
| 928 RefPtr<HistoryItem> currentItem = frame()->loader()->history()->currentItem(
); | 928 RefPtr<HistoryItem> currentItem = frame()->loader().history()->currentItem()
; |
| 929 m_inSameDocumentHistoryLoad = currentItem && currentItem->shouldDoSameDocume
ntNavigationTo(historyItem.get()); | 929 m_inSameDocumentHistoryLoad = currentItem && currentItem->shouldDoSameDocume
ntNavigationTo(historyItem.get()); |
| 930 frame()->page()->goToItem(historyItem.get()); | 930 frame()->page()->goToItem(historyItem.get()); |
| 931 m_inSameDocumentHistoryLoad = false; | 931 m_inSameDocumentHistoryLoad = false; |
| 932 } | 932 } |
| 933 | 933 |
| 934 void WebFrameImpl::loadData(const WebData& data, const WebString& mimeType, cons
t WebString& textEncoding, const WebURL& baseURL, const WebURL& unreachableURL,
bool replace) | 934 void WebFrameImpl::loadData(const WebData& data, const WebString& mimeType, cons
t WebString& textEncoding, const WebURL& baseURL, const WebURL& unreachableURL,
bool replace) |
| 935 { | 935 { |
| 936 ASSERT(frame()); | 936 ASSERT(frame()); |
| 937 | 937 |
| 938 // If we are loading substitute data to replace an existing load, then | 938 // If we are loading substitute data to replace an existing load, then |
| 939 // inherit all of the properties of that original request. This way, | 939 // inherit all of the properties of that original request. This way, |
| 940 // reload will re-attempt the original request. It is essential that | 940 // reload will re-attempt the original request. It is essential that |
| 941 // we only do this when there is an unreachableURL since a non-empty | 941 // we only do this when there is an unreachableURL since a non-empty |
| 942 // unreachableURL informs FrameLoader::reload to load unreachableURL | 942 // unreachableURL informs FrameLoader::reload to load unreachableURL |
| 943 // instead of the currently loaded URL. | 943 // instead of the currently loaded URL. |
| 944 ResourceRequest request; | 944 ResourceRequest request; |
| 945 if (replace && !unreachableURL.isEmpty()) | 945 if (replace && !unreachableURL.isEmpty()) |
| 946 request = frame()->loader()->originalRequest(); | 946 request = frame()->loader().originalRequest(); |
| 947 request.setURL(baseURL); | 947 request.setURL(baseURL); |
| 948 | 948 |
| 949 FrameLoadRequest frameRequest(0, request, SubstituteData(data, mimeType, tex
tEncoding, unreachableURL)); | 949 FrameLoadRequest frameRequest(0, request, SubstituteData(data, mimeType, tex
tEncoding, unreachableURL)); |
| 950 ASSERT(frameRequest.substituteData().isValid()); | 950 ASSERT(frameRequest.substituteData().isValid()); |
| 951 frameRequest.setLockBackForwardList(replace); | 951 frameRequest.setLockBackForwardList(replace); |
| 952 frame()->loader()->load(frameRequest); | 952 frame()->loader().load(frameRequest); |
| 953 } | 953 } |
| 954 | 954 |
| 955 void WebFrameImpl::loadHTMLString(const WebData& data, const WebURL& baseURL, co
nst WebURL& unreachableURL, bool replace) | 955 void WebFrameImpl::loadHTMLString(const WebData& data, const WebURL& baseURL, co
nst WebURL& unreachableURL, bool replace) |
| 956 { | 956 { |
| 957 ASSERT(frame()); | 957 ASSERT(frame()); |
| 958 loadData(data, WebString::fromUTF8("text/html"), WebString::fromUTF8("UTF-8"
), baseURL, unreachableURL, replace); | 958 loadData(data, WebString::fromUTF8("text/html"), WebString::fromUTF8("UTF-8"
), baseURL, unreachableURL, replace); |
| 959 } | 959 } |
| 960 | 960 |
| 961 bool WebFrameImpl::isLoading() const | 961 bool WebFrameImpl::isLoading() const |
| 962 { | 962 { |
| 963 if (!frame()) | 963 if (!frame()) |
| 964 return false; | 964 return false; |
| 965 return frame()->loader()->isLoading(); | 965 return frame()->loader().isLoading(); |
| 966 } | 966 } |
| 967 | 967 |
| 968 void WebFrameImpl::stopLoading() | 968 void WebFrameImpl::stopLoading() |
| 969 { | 969 { |
| 970 if (!frame()) | 970 if (!frame()) |
| 971 return; | 971 return; |
| 972 // FIXME: Figure out what we should really do here. It seems like a bug | 972 // FIXME: Figure out what we should really do here. It seems like a bug |
| 973 // that FrameLoader::stopLoading doesn't call stopAllLoaders. | 973 // that FrameLoader::stopLoading doesn't call stopAllLoaders. |
| 974 frame()->loader()->stopAllLoaders(); | 974 frame()->loader().stopAllLoaders(); |
| 975 } | 975 } |
| 976 | 976 |
| 977 WebDataSource* WebFrameImpl::provisionalDataSource() const | 977 WebDataSource* WebFrameImpl::provisionalDataSource() const |
| 978 { | 978 { |
| 979 ASSERT(frame()); | 979 ASSERT(frame()); |
| 980 | 980 |
| 981 // We regard the policy document loader as still provisional. | 981 // We regard the policy document loader as still provisional. |
| 982 DocumentLoader* documentLoader = frame()->loader()->provisionalDocumentLoade
r(); | 982 DocumentLoader* documentLoader = frame()->loader().provisionalDocumentLoader
(); |
| 983 if (!documentLoader) | 983 if (!documentLoader) |
| 984 documentLoader = frame()->loader()->policyDocumentLoader(); | 984 documentLoader = frame()->loader().policyDocumentLoader(); |
| 985 | 985 |
| 986 return DataSourceForDocLoader(documentLoader); | 986 return DataSourceForDocLoader(documentLoader); |
| 987 } | 987 } |
| 988 | 988 |
| 989 WebDataSource* WebFrameImpl::dataSource() const | 989 WebDataSource* WebFrameImpl::dataSource() const |
| 990 { | 990 { |
| 991 ASSERT(frame()); | 991 ASSERT(frame()); |
| 992 return DataSourceForDocLoader(frame()->loader()->documentLoader()); | 992 return DataSourceForDocLoader(frame()->loader().documentLoader()); |
| 993 } | 993 } |
| 994 | 994 |
| 995 WebHistoryItem WebFrameImpl::previousHistoryItem() const | 995 WebHistoryItem WebFrameImpl::previousHistoryItem() const |
| 996 { | 996 { |
| 997 ASSERT(frame()); | 997 ASSERT(frame()); |
| 998 // We use the previous item here because documentState (filled-out forms) | 998 // We use the previous item here because documentState (filled-out forms) |
| 999 // only get saved to history when it becomes the previous item. The caller | 999 // only get saved to history when it becomes the previous item. The caller |
| 1000 // is expected to query the history item after a navigation occurs, after | 1000 // is expected to query the history item after a navigation occurs, after |
| 1001 // the desired history item has become the previous entry. | 1001 // the desired history item has become the previous entry. |
| 1002 return WebHistoryItem(frame()->loader()->history()->previousItem()); | 1002 return WebHistoryItem(frame()->loader().history()->previousItem()); |
| 1003 } | 1003 } |
| 1004 | 1004 |
| 1005 WebHistoryItem WebFrameImpl::currentHistoryItem() const | 1005 WebHistoryItem WebFrameImpl::currentHistoryItem() const |
| 1006 { | 1006 { |
| 1007 ASSERT(frame()); | 1007 ASSERT(frame()); |
| 1008 | 1008 |
| 1009 // We're shutting down. | 1009 // We're shutting down. |
| 1010 if (!frame()->loader()->activeDocumentLoader()) | 1010 if (!frame()->loader().activeDocumentLoader()) |
| 1011 return WebHistoryItem(); | 1011 return WebHistoryItem(); |
| 1012 | 1012 |
| 1013 // If we are still loading, then we don't want to clobber the current | 1013 // If we are still loading, then we don't want to clobber the current |
| 1014 // history item as this could cause us to lose the scroll position and | 1014 // history item as this could cause us to lose the scroll position and |
| 1015 // document state. However, it is OK for new navigations. | 1015 // document state. However, it is OK for new navigations. |
| 1016 // FIXME: Can we make this a plain old getter, instead of worrying about | 1016 // FIXME: Can we make this a plain old getter, instead of worrying about |
| 1017 // clobbering here? | 1017 // clobbering here? |
| 1018 if (!m_inSameDocumentHistoryLoad && (frame()->loader()->loadType() == FrameL
oadTypeStandard | 1018 if (!m_inSameDocumentHistoryLoad && (frame()->loader().loadType() == FrameLo
adTypeStandard |
| 1019 || !frame()->loader()->activeDocumentLoader()->isLoadingInAPISense())) | 1019 || !frame()->loader().activeDocumentLoader()->isLoadingInAPISense())) |
| 1020 frame()->loader()->history()->saveDocumentAndScrollState(); | 1020 frame()->loader().history()->saveDocumentAndScrollState(); |
| 1021 | 1021 |
| 1022 if (HistoryItem* item = frame()->loader()->history()->provisionalItem()) | 1022 if (HistoryItem* item = frame()->loader().history()->provisionalItem()) |
| 1023 return WebHistoryItem(item); | 1023 return WebHistoryItem(item); |
| 1024 return WebHistoryItem(frame()->page()->mainFrame()->loader()->history()->cur
rentItem()); | 1024 return WebHistoryItem(frame()->page()->mainFrame()->loader().history()->curr
entItem()); |
| 1025 } | 1025 } |
| 1026 | 1026 |
| 1027 void WebFrameImpl::enableViewSourceMode(bool enable) | 1027 void WebFrameImpl::enableViewSourceMode(bool enable) |
| 1028 { | 1028 { |
| 1029 if (frame()) | 1029 if (frame()) |
| 1030 frame()->setInViewSourceMode(enable); | 1030 frame()->setInViewSourceMode(enable); |
| 1031 } | 1031 } |
| 1032 | 1032 |
| 1033 bool WebFrameImpl::isViewSourceModeEnabled() const | 1033 bool WebFrameImpl::isViewSourceModeEnabled() const |
| 1034 { | 1034 { |
| 1035 if (!frame()) | 1035 if (!frame()) |
| 1036 return false; | 1036 return false; |
| 1037 return frame()->inViewSourceMode(); | 1037 return frame()->inViewSourceMode(); |
| 1038 } | 1038 } |
| 1039 | 1039 |
| 1040 void WebFrameImpl::setReferrerForRequest(WebURLRequest& request, const WebURL& r
eferrerURL) | 1040 void WebFrameImpl::setReferrerForRequest(WebURLRequest& request, const WebURL& r
eferrerURL) |
| 1041 { | 1041 { |
| 1042 String referrer = referrerURL.isEmpty() ? frame()->loader()->outgoingReferre
r() : String(referrerURL.spec().utf16()); | 1042 String referrer = referrerURL.isEmpty() ? frame()->loader().outgoingReferrer
() : String(referrerURL.spec().utf16()); |
| 1043 referrer = SecurityPolicy::generateReferrerHeader(frame()->document()->refer
rerPolicy(), request.url(), referrer); | 1043 referrer = SecurityPolicy::generateReferrerHeader(frame()->document()->refer
rerPolicy(), request.url(), referrer); |
| 1044 if (referrer.isEmpty()) | 1044 if (referrer.isEmpty()) |
| 1045 return; | 1045 return; |
| 1046 request.setHTTPHeaderField(WebString::fromUTF8("Referer"), referrer); | 1046 request.setHTTPHeaderField(WebString::fromUTF8("Referer"), referrer); |
| 1047 } | 1047 } |
| 1048 | 1048 |
| 1049 void WebFrameImpl::dispatchWillSendRequest(WebURLRequest& request) | 1049 void WebFrameImpl::dispatchWillSendRequest(WebURLRequest& request) |
| 1050 { | 1050 { |
| 1051 ResourceResponse response; | 1051 ResourceResponse response; |
| 1052 frame()->loader()->client()->dispatchWillSendRequest(0, 0, request.toMutable
ResourceRequest(), response); | 1052 frame()->loader().client()->dispatchWillSendRequest(0, 0, request.toMutableR
esourceRequest(), response); |
| 1053 } | 1053 } |
| 1054 | 1054 |
| 1055 WebURLLoader* WebFrameImpl::createAssociatedURLLoader(const WebURLLoaderOptions&
options) | 1055 WebURLLoader* WebFrameImpl::createAssociatedURLLoader(const WebURLLoaderOptions&
options) |
| 1056 { | 1056 { |
| 1057 return new AssociatedURLLoader(this, options); | 1057 return new AssociatedURLLoader(this, options); |
| 1058 } | 1058 } |
| 1059 | 1059 |
| 1060 unsigned WebFrameImpl::unloadListenerCount() const | 1060 unsigned WebFrameImpl::unloadListenerCount() const |
| 1061 { | 1061 { |
| 1062 return frame()->domWindow()->pendingUnloadEventListeners(); | 1062 return frame()->domWindow()->pendingUnloadEventListeners(); |
| 1063 } | 1063 } |
| 1064 | 1064 |
| 1065 bool WebFrameImpl::willSuppressOpenerInNewFrame() const | 1065 bool WebFrameImpl::willSuppressOpenerInNewFrame() const |
| 1066 { | 1066 { |
| 1067 return frame()->loader()->suppressOpenerInNewFrame(); | 1067 return frame()->loader().suppressOpenerInNewFrame(); |
| 1068 } | 1068 } |
| 1069 | 1069 |
| 1070 void WebFrameImpl::replaceSelection(const WebString& text) | 1070 void WebFrameImpl::replaceSelection(const WebString& text) |
| 1071 { | 1071 { |
| 1072 bool selectReplacement = false; | 1072 bool selectReplacement = false; |
| 1073 bool smartReplace = true; | 1073 bool smartReplace = true; |
| 1074 frame()->editor().replaceSelectionWithText(text, selectReplacement, smartRep
lace); | 1074 frame()->editor().replaceSelectionWithText(text, selectReplacement, smartRep
lace); |
| 1075 } | 1075 } |
| 1076 | 1076 |
| 1077 void WebFrameImpl::insertText(const WebString& text) | 1077 void WebFrameImpl::insertText(const WebString& text) |
| (...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2189 // onload event handler. | 2189 // onload event handler. |
| 2190 // Because the event handler may set webframe->mFrame to null, | 2190 // Because the event handler may set webframe->mFrame to null, |
| 2191 // it is necessary to check the value after calling init() and | 2191 // it is necessary to check the value after calling init() and |
| 2192 // return without loading URL. | 2192 // return without loading URL. |
| 2193 // NOTE: m_client will be null if this frame has been detached. | 2193 // NOTE: m_client will be null if this frame has been detached. |
| 2194 // (b:791612) | 2194 // (b:791612) |
| 2195 childFrame->init(); // create an empty document | 2195 childFrame->init(); // create an empty document |
| 2196 if (!childFrame->tree().parent()) | 2196 if (!childFrame->tree().parent()) |
| 2197 return 0; | 2197 return 0; |
| 2198 | 2198 |
| 2199 HistoryItem* parentItem = frame()->loader()->history()->currentItem(); | 2199 HistoryItem* parentItem = frame()->loader().history()->currentItem(); |
| 2200 HistoryItem* childItem = 0; | 2200 HistoryItem* childItem = 0; |
| 2201 // If we're moving in the back/forward list, we might want to replace the co
ntent | 2201 // If we're moving in the back/forward list, we might want to replace the co
ntent |
| 2202 // of this child frame with whatever was there at that point. | 2202 // of this child frame with whatever was there at that point. |
| 2203 if (parentItem && parentItem->children().size() && isBackForwardLoadType(fra
me()->loader()->loadType()) && !frame()->document()->loadEventFinished()) | 2203 if (parentItem && parentItem->children().size() && isBackForwardLoadType(fra
me()->loader().loadType()) && !frame()->document()->loadEventFinished()) |
| 2204 childItem = parentItem->childItemWithTarget(childFrame->tree().uniqueNam
e()); | 2204 childItem = parentItem->childItemWithTarget(childFrame->tree().uniqueNam
e()); |
| 2205 | 2205 |
| 2206 if (childItem) | 2206 if (childItem) |
| 2207 childFrame->loader()->loadHistoryItem(childItem); | 2207 childFrame->loader().loadHistoryItem(childItem); |
| 2208 else | 2208 else |
| 2209 childFrame->loader()->load(FrameLoadRequest(0, request.resourceRequest()
, "_self")); | 2209 childFrame->loader().load(FrameLoadRequest(0, request.resourceRequest(),
"_self")); |
| 2210 | 2210 |
| 2211 // A synchronous navigation (about:blank) would have already processed | 2211 // A synchronous navigation (about:blank) would have already processed |
| 2212 // onload, so it is possible for the frame to have already been destroyed by | 2212 // onload, so it is possible for the frame to have already been destroyed by |
| 2213 // script in the page. | 2213 // script in the page. |
| 2214 // NOTE: m_client will be null if this frame has been detached. | 2214 // NOTE: m_client will be null if this frame has been detached. |
| 2215 if (!childFrame->tree().parent()) | 2215 if (!childFrame->tree().parent()) |
| 2216 return 0; | 2216 return 0; |
| 2217 | 2217 |
| 2218 return childFrame.release(); | 2218 return childFrame.release(); |
| 2219 } | 2219 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 2245 frame()->view()->setInputEventsScaleFactorForEmulation(m_inputEventsScaleFac
torForEmulation); | 2245 frame()->view()->setInputEventsScaleFactorForEmulation(m_inputEventsScaleFac
torForEmulation); |
| 2246 | 2246 |
| 2247 if (isMainFrame) | 2247 if (isMainFrame) |
| 2248 webView->suppressInvalidations(false); | 2248 webView->suppressInvalidations(false); |
| 2249 } | 2249 } |
| 2250 | 2250 |
| 2251 WebFrameImpl* WebFrameImpl::fromFrame(Frame* frame) | 2251 WebFrameImpl* WebFrameImpl::fromFrame(Frame* frame) |
| 2252 { | 2252 { |
| 2253 if (!frame) | 2253 if (!frame) |
| 2254 return 0; | 2254 return 0; |
| 2255 return toFrameLoaderClientImpl(frame->loader()->client())->webFrame(); | 2255 return toFrameLoaderClientImpl(frame->loader().client())->webFrame(); |
| 2256 } | 2256 } |
| 2257 | 2257 |
| 2258 WebFrameImpl* WebFrameImpl::fromFrameOwnerElement(Element* element) | 2258 WebFrameImpl* WebFrameImpl::fromFrameOwnerElement(Element* element) |
| 2259 { | 2259 { |
| 2260 // FIXME: Why do we check specifically for <iframe> and <frame> here? Why ca
n't we get the WebFrameImpl from an <object> element, for example. | 2260 // FIXME: Why do we check specifically for <iframe> and <frame> here? Why ca
n't we get the WebFrameImpl from an <object> element, for example. |
| 2261 if (!element || !element->isFrameOwnerElement() || (!element->hasTagName(HTM
LNames::iframeTag) && !element->hasTagName(HTMLNames::frameTag))) | 2261 if (!element || !element->isFrameOwnerElement() || (!element->hasTagName(HTM
LNames::iframeTag) && !element->hasTagName(HTMLNames::frameTag))) |
| 2262 return 0; | 2262 return 0; |
| 2263 return fromFrame(toHTMLFrameOwnerElement(element)->contentFrame()); | 2263 return fromFrame(toHTMLFrameOwnerElement(element)->contentFrame()); |
| 2264 } | 2264 } |
| 2265 | 2265 |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2518 | 2518 |
| 2519 // There is a possibility that the frame being detached was the only | 2519 // There is a possibility that the frame being detached was the only |
| 2520 // pending one. We need to make sure final replies can be sent. | 2520 // pending one. We need to make sure final replies can be sent. |
| 2521 flushCurrentScopingEffort(m_findRequestIdentifier); | 2521 flushCurrentScopingEffort(m_findRequestIdentifier); |
| 2522 | 2522 |
| 2523 cancelPendingScopingEffort(); | 2523 cancelPendingScopingEffort(); |
| 2524 } | 2524 } |
| 2525 } | 2525 } |
| 2526 | 2526 |
| 2527 } // namespace WebKit | 2527 } // namespace WebKit |
| OLD | NEW |