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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 #include "core/dom/Document.h" | 57 #include "core/dom/Document.h" |
58 #include "core/dom/DocumentFullscreen.h" | 58 #include "core/dom/DocumentFullscreen.h" |
59 #include "core/events/MessageEvent.h" | 59 #include "core/events/MessageEvent.h" |
60 #include "core/events/MouseEvent.h" | 60 #include "core/events/MouseEvent.h" |
61 #include "core/dom/WheelController.h" | 61 #include "core/dom/WheelController.h" |
62 #include "core/html/HTMLAppletElement.h" | 62 #include "core/html/HTMLAppletElement.h" |
63 #include "core/loader/DocumentLoader.h" | 63 #include "core/loader/DocumentLoader.h" |
64 #include "core/loader/FrameLoadRequest.h" | 64 #include "core/loader/FrameLoadRequest.h" |
65 #include "core/loader/FrameLoader.h" | 65 #include "core/loader/FrameLoader.h" |
66 #include "core/loader/HistoryItem.h" | 66 #include "core/loader/HistoryItem.h" |
| 67 #include "core/loader/ProgressTracker.h" |
67 #include "core/page/Chrome.h" | 68 #include "core/page/Chrome.h" |
68 #include "core/page/EventHandler.h" | 69 #include "core/page/EventHandler.h" |
69 #include "core/frame/FrameView.h" | 70 #include "core/frame/FrameView.h" |
70 #include "core/page/Page.h" | 71 #include "core/page/Page.h" |
71 #include "core/frame/Settings.h" | 72 #include "core/frame/Settings.h" |
72 #include "core/page/WindowFeatures.h" | 73 #include "core/page/WindowFeatures.h" |
73 #include "core/rendering/HitTestResult.h" | 74 #include "core/rendering/HitTestResult.h" |
74 #include "modules/device_orientation/DeviceMotionController.h" | 75 #include "modules/device_orientation/DeviceMotionController.h" |
75 #include "modules/device_orientation/DeviceOrientationController.h" | 76 #include "modules/device_orientation/DeviceOrientationController.h" |
76 #include "modules/gamepad/NavigatorGamepad.h" | 77 #include "modules/gamepad/NavigatorGamepad.h" |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 if (m_webFrame->client()) | 486 if (m_webFrame->client()) |
486 m_webFrame->client()->willSendSubmitEvent(m_webFrame, WebFormElement(for
m)); | 487 m_webFrame->client()->willSendSubmitEvent(m_webFrame, WebFormElement(for
m)); |
487 } | 488 } |
488 | 489 |
489 void FrameLoaderClientImpl::dispatchWillSubmitForm(HTMLFormElement* form) | 490 void FrameLoaderClientImpl::dispatchWillSubmitForm(HTMLFormElement* form) |
490 { | 491 { |
491 if (m_webFrame->client()) | 492 if (m_webFrame->client()) |
492 m_webFrame->client()->willSubmitForm(m_webFrame, WebFormElement(form)); | 493 m_webFrame->client()->willSubmitForm(m_webFrame, WebFormElement(form)); |
493 } | 494 } |
494 | 495 |
495 void FrameLoaderClientImpl::didStartLoading(LoadStartType loadStartType) | 496 void FrameLoaderClientImpl::postProgressStartedNotification(LoadStartType loadSt
artType) |
496 { | 497 { |
497 if (m_webFrame->client()) | 498 WebViewImpl* webview = m_webFrame->viewImpl(); |
498 m_webFrame->client()->didStartLoading(loadStartType == NavigationToDiffe
rentDocument); | 499 if (webview && webview->client()) |
| 500 webview->client()->didStartLoading(loadStartType == NavigationToDifferen
tDocument); |
499 } | 501 } |
500 | 502 |
501 void FrameLoaderClientImpl::progressEstimateChanged(double progressEstimate) | 503 void FrameLoaderClientImpl::postProgressEstimateChangedNotification() |
502 { | 504 { |
503 if (m_webFrame->client()) | 505 WebViewImpl* webview = m_webFrame->viewImpl(); |
504 m_webFrame->client()->didChangeLoadProgress(progressEstimate); | 506 if (webview && webview->client()) { |
| 507 webview->client()->didChangeLoadProgress( |
| 508 m_webFrame, m_webFrame->frame()->page()->progress().estimatedProgres
s()); |
| 509 } |
505 } | 510 } |
506 | 511 |
507 void FrameLoaderClientImpl::didStopLoading() | 512 void FrameLoaderClientImpl::postProgressFinishedNotification() |
508 { | 513 { |
509 if (m_webFrame->client()) | 514 // FIXME: why might the webview be null? http://b/1234461 |
510 m_webFrame->client()->didStopLoading(); | 515 WebViewImpl* webview = m_webFrame->viewImpl(); |
| 516 if (webview && webview->client()) |
| 517 webview->client()->didStopLoading(); |
511 } | 518 } |
512 | 519 |
513 void FrameLoaderClientImpl::loadURLExternally(const ResourceRequest& request, Na
vigationPolicy policy, const String& suggestedName) | 520 void FrameLoaderClientImpl::loadURLExternally(const ResourceRequest& request, Na
vigationPolicy policy, const String& suggestedName) |
514 { | 521 { |
515 if (m_webFrame->client()) { | 522 if (m_webFrame->client()) { |
516 ASSERT(m_webFrame->frame()->document()); | 523 ASSERT(m_webFrame->frame()->document()); |
517 DocumentFullscreen::webkitCancelFullScreen(*m_webFrame->frame()->documen
t()); | 524 DocumentFullscreen::webkitCancelFullScreen(*m_webFrame->frame()->documen
t()); |
518 WrappedResourceRequest webreq(request); | 525 WrappedResourceRequest webreq(request); |
519 m_webFrame->client()->loadURLExternally( | 526 m_webFrame->client()->loadURLExternally( |
520 m_webFrame, webreq, static_cast<WebNavigationPolicy>(policy), sugges
tedName); | 527 m_webFrame, webreq, static_cast<WebNavigationPolicy>(policy), sugges
tedName); |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 return adoptPtr(m_webFrame->client()->createApplicationCacheHost(m_webFrame,
client)); | 801 return adoptPtr(m_webFrame->client()->createApplicationCacheHost(m_webFrame,
client)); |
795 } | 802 } |
796 | 803 |
797 void FrameLoaderClientImpl::didStopAllLoaders() | 804 void FrameLoaderClientImpl::didStopAllLoaders() |
798 { | 805 { |
799 if (m_webFrame->client()) | 806 if (m_webFrame->client()) |
800 m_webFrame->client()->didAbortLoading(m_webFrame); | 807 m_webFrame->client()->didAbortLoading(m_webFrame); |
801 } | 808 } |
802 | 809 |
803 } // namespace blink | 810 } // namespace blink |
OLD | NEW |