| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 #include "public/web/WebPlugin.h" | 92 #include "public/web/WebPlugin.h" |
| 93 #include "public/web/WebPluginParams.h" | 93 #include "public/web/WebPluginParams.h" |
| 94 #include "public/web/WebViewClient.h" | 94 #include "public/web/WebViewClient.h" |
| 95 #include "web/DevToolsEmulator.h" | 95 #include "web/DevToolsEmulator.h" |
| 96 #include "web/SharedWorkerRepositoryClientImpl.h" | 96 #include "web/SharedWorkerRepositoryClientImpl.h" |
| 97 #include "web/WebDataSourceImpl.h" | 97 #include "web/WebDataSourceImpl.h" |
| 98 #include "web/WebDevToolsAgentImpl.h" | 98 #include "web/WebDevToolsAgentImpl.h" |
| 99 #include "web/WebDevToolsFrontendImpl.h" | 99 #include "web/WebDevToolsFrontendImpl.h" |
| 100 #include "web/WebLocalFrameImpl.h" | 100 #include "web/WebLocalFrameImpl.h" |
| 101 #include "web/WebPluginContainerImpl.h" | 101 #include "web/WebPluginContainerImpl.h" |
| 102 #include "web/WebPluginLoadObserver.h" | |
| 103 #include "web/WebViewImpl.h" | 102 #include "web/WebViewImpl.h" |
| 104 #include "wtf/StringExtras.h" | 103 #include "wtf/StringExtras.h" |
| 105 #include "wtf/text/CString.h" | 104 #include "wtf/text/CString.h" |
| 106 #include "wtf/text/WTFString.h" | 105 #include "wtf/text/WTFString.h" |
| 107 #include <v8.h> | 106 #include <v8.h> |
| 108 | 107 |
| 109 namespace blink { | 108 namespace blink { |
| 110 | 109 |
| 111 FrameLoaderClientImpl::FrameLoaderClientImpl(WebLocalFrameImpl* frame) | 110 FrameLoaderClientImpl::FrameLoaderClientImpl(WebLocalFrameImpl* frame) |
| 112 : m_webFrame(frame) | 111 : m_webFrame(frame) |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 if (m_webFrame->client()) | 471 if (m_webFrame->client()) |
| 473 m_webFrame->client()->didCommitProvisionalLoad(m_webFrame, WebHistoryIte
m(item), static_cast<WebHistoryCommitType>(commitType)); | 472 m_webFrame->client()->didCommitProvisionalLoad(m_webFrame, WebHistoryIte
m(item), static_cast<WebHistoryCommitType>(commitType)); |
| 474 WebDevToolsAgentImpl* devToolsAgent = WebLocalFrameImpl::fromFrame(m_webFram
e->frame()->localFrameRoot())->devToolsAgentImpl(); | 473 WebDevToolsAgentImpl* devToolsAgent = WebLocalFrameImpl::fromFrame(m_webFram
e->frame()->localFrameRoot())->devToolsAgentImpl(); |
| 475 if (devToolsAgent) | 474 if (devToolsAgent) |
| 476 devToolsAgent->didCommitLoadForLocalFrame(m_webFrame->frame()); | 475 devToolsAgent->didCommitLoadForLocalFrame(m_webFrame->frame()); |
| 477 } | 476 } |
| 478 | 477 |
| 479 void FrameLoaderClientImpl::dispatchDidFailProvisionalLoad( | 478 void FrameLoaderClientImpl::dispatchDidFailProvisionalLoad( |
| 480 const ResourceError& error, HistoryCommitType commitType) | 479 const ResourceError& error, HistoryCommitType commitType) |
| 481 { | 480 { |
| 482 OwnPtrWillBeRawPtr<WebPluginLoadObserver> observer = pluginLoadObserver(m_we
bFrame->frame()->loader().provisionalDocumentLoader()); | |
| 483 m_webFrame->didFail(error, true, commitType); | 481 m_webFrame->didFail(error, true, commitType); |
| 484 if (observer) | |
| 485 observer->didFailLoading(error); | |
| 486 } | 482 } |
| 487 | 483 |
| 488 void FrameLoaderClientImpl::dispatchDidFailLoad(const ResourceError& error, Hist
oryCommitType commitType) | 484 void FrameLoaderClientImpl::dispatchDidFailLoad(const ResourceError& error, Hist
oryCommitType commitType) |
| 489 { | 485 { |
| 490 OwnPtrWillBeRawPtr<WebPluginLoadObserver> observer = pluginLoadObserver(m_we
bFrame->frame()->loader().documentLoader()); | |
| 491 m_webFrame->didFail(error, false, commitType); | 486 m_webFrame->didFail(error, false, commitType); |
| 492 if (observer) | |
| 493 observer->didFailLoading(error); | |
| 494 | |
| 495 // Don't clear the redirect chain, this will happen in the middle of client | |
| 496 // redirects, and we need the context. The chain will be cleared when the | |
| 497 // provisional load succeeds or fails, not the "real" one. | |
| 498 } | 487 } |
| 499 | 488 |
| 500 void FrameLoaderClientImpl::dispatchDidFinishLoad() | 489 void FrameLoaderClientImpl::dispatchDidFinishLoad() |
| 501 { | 490 { |
| 502 OwnPtrWillBeRawPtr<WebPluginLoadObserver> observer = pluginLoadObserver(m_we
bFrame->frame()->loader().documentLoader()); | 491 m_webFrame->didFinish(); |
| 503 | |
| 504 if (m_webFrame->client()) | |
| 505 m_webFrame->client()->didFinishLoad(m_webFrame); | |
| 506 | |
| 507 if (observer) | |
| 508 observer->didFinishLoading(); | |
| 509 | |
| 510 // Don't clear the redirect chain, this will happen in the middle of client | |
| 511 // redirects, and we need the context. The chain will be cleared when the | |
| 512 // provisional load succeeds or fails, not the "real" one. | |
| 513 } | 492 } |
| 514 | 493 |
| 515 void FrameLoaderClientImpl::dispatchDidChangeThemeColor() | 494 void FrameLoaderClientImpl::dispatchDidChangeThemeColor() |
| 516 { | 495 { |
| 517 if (m_webFrame->client()) | 496 if (m_webFrame->client()) |
| 518 m_webFrame->client()->didChangeThemeColor(); | 497 m_webFrame->client()->didChangeThemeColor(); |
| 519 } | 498 } |
| 520 | 499 |
| 521 static bool allowCreatingBackgroundTabs() | 500 static bool allowCreatingBackgroundTabs() |
| 522 { | 501 { |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 | 817 |
| 839 if (plugInSupportsMIMEType) | 818 if (plugInSupportsMIMEType) |
| 840 return ObjectContentNetscapePlugin; | 819 return ObjectContentNetscapePlugin; |
| 841 | 820 |
| 842 if (MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType)) | 821 if (MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType)) |
| 843 return ObjectContentFrame; | 822 return ObjectContentFrame; |
| 844 | 823 |
| 845 return ObjectContentNone; | 824 return ObjectContentNone; |
| 846 } | 825 } |
| 847 | 826 |
| 848 PassOwnPtrWillBeRawPtr<WebPluginLoadObserver> FrameLoaderClientImpl::pluginLoadO
bserver(DocumentLoader* loader) | |
| 849 { | |
| 850 return WebDataSourceImpl::fromDocumentLoader(loader)->releasePluginLoadObser
ver(); | |
| 851 } | |
| 852 | |
| 853 WebCookieJar* FrameLoaderClientImpl::cookieJar() const | 827 WebCookieJar* FrameLoaderClientImpl::cookieJar() const |
| 854 { | 828 { |
| 855 if (!m_webFrame->client()) | 829 if (!m_webFrame->client()) |
| 856 return 0; | 830 return 0; |
| 857 return m_webFrame->client()->cookieJar(m_webFrame); | 831 return m_webFrame->client()->cookieJar(m_webFrame); |
| 858 } | 832 } |
| 859 | 833 |
| 860 bool FrameLoaderClientImpl::willCheckAndDispatchMessageEvent( | 834 bool FrameLoaderClientImpl::willCheckAndDispatchMessageEvent( |
| 861 SecurityOrigin* target, MessageEvent* event, LocalFrame* sourceFrame) const | 835 SecurityOrigin* target, MessageEvent* event, LocalFrame* sourceFrame) const |
| 862 { | 836 { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 return m_webFrame->sharedWorkerRepositoryClient(); | 930 return m_webFrame->sharedWorkerRepositoryClient(); |
| 957 } | 931 } |
| 958 | 932 |
| 959 PassOwnPtr<WebApplicationCacheHost> FrameLoaderClientImpl::createApplicationCach
eHost(WebApplicationCacheHostClient* client) | 933 PassOwnPtr<WebApplicationCacheHost> FrameLoaderClientImpl::createApplicationCach
eHost(WebApplicationCacheHostClient* client) |
| 960 { | 934 { |
| 961 if (!m_webFrame->client()) | 935 if (!m_webFrame->client()) |
| 962 return nullptr; | 936 return nullptr; |
| 963 return adoptPtr(m_webFrame->client()->createApplicationCacheHost(m_webFrame,
client)); | 937 return adoptPtr(m_webFrame->client()->createApplicationCacheHost(m_webFrame,
client)); |
| 964 } | 938 } |
| 965 | 939 |
| 966 void FrameLoaderClientImpl::didStopAllLoaders() | |
| 967 { | |
| 968 if (m_webFrame->client()) | |
| 969 m_webFrame->client()->didAbortLoading(m_webFrame); | |
| 970 } | |
| 971 | |
| 972 void FrameLoaderClientImpl::dispatchDidChangeManifest() | 940 void FrameLoaderClientImpl::dispatchDidChangeManifest() |
| 973 { | 941 { |
| 974 if (m_webFrame->client()) | 942 if (m_webFrame->client()) |
| 975 m_webFrame->client()->didChangeManifest(m_webFrame); | 943 m_webFrame->client()->didChangeManifest(m_webFrame); |
| 976 } | 944 } |
| 977 | 945 |
| 978 unsigned FrameLoaderClientImpl::backForwardLength() | 946 unsigned FrameLoaderClientImpl::backForwardLength() |
| 979 { | 947 { |
| 980 WebViewImpl* webview = m_webFrame->viewImpl(); | 948 WebViewImpl* webview = m_webFrame->viewImpl(); |
| 981 if (!webview || !webview->client()) | 949 if (!webview || !webview->client()) |
| 982 return 0; | 950 return 0; |
| 983 return webview->client()->historyBackListCount() + 1 + webview->client()->hi
storyForwardListCount(); | 951 return webview->client()->historyBackListCount() + 1 + webview->client()->hi
storyForwardListCount(); |
| 984 } | 952 } |
| 985 | 953 |
| 986 void FrameLoaderClientImpl::suddenTerminationDisablerChanged(bool present, Sudde
nTerminationDisablerType type) | 954 void FrameLoaderClientImpl::suddenTerminationDisablerChanged(bool present, Sudde
nTerminationDisablerType type) |
| 987 { | 955 { |
| 988 if (m_webFrame->client()) { | 956 if (m_webFrame->client()) { |
| 989 m_webFrame->client()->suddenTerminationDisablerChanged( | 957 m_webFrame->client()->suddenTerminationDisablerChanged( |
| 990 present, static_cast<WebFrameClient::SuddenTerminationDisablerType>(
type)); | 958 present, static_cast<WebFrameClient::SuddenTerminationDisablerType>(
type)); |
| 991 } | 959 } |
| 992 } | 960 } |
| 993 | 961 |
| 994 } // namespace blink | 962 } // namespace blink |
| OLD | NEW |