OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "Chrome.h" | 7 #include "Chrome.h" |
8 #include "CString.h" | 8 #include "CString.h" |
9 #include "Document.h" | 9 #include "Document.h" |
10 #include "DocumentLoader.h" | 10 #include "DocumentLoader.h" |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 // (see - https://bugs.webkit.org/show_bug.cgi?id=23554). | 793 // (see - https://bugs.webkit.org/show_bug.cgi?id=23554). |
794 if (webframe_->client() && !request.url().isNull()) { | 794 if (webframe_->client() && !request.url().isNull()) { |
795 WebNavigationPolicy navigation_policy = | 795 WebNavigationPolicy navigation_policy = |
796 WebKit::WebNavigationPolicyCurrentTab; | 796 WebKit::WebNavigationPolicyCurrentTab; |
797 ActionSpecifiesNavigationPolicy(action, &navigation_policy); | 797 ActionSpecifiesNavigationPolicy(action, &navigation_policy); |
798 | 798 |
799 // Give the delegate a chance to change the navigation policy. | 799 // Give the delegate a chance to change the navigation policy. |
800 const WebDataSourceImpl* ds = webframe_->GetProvisionalDataSourceImpl(); | 800 const WebDataSourceImpl* ds = webframe_->GetProvisionalDataSourceImpl(); |
801 if (ds) { | 801 if (ds) { |
802 KURL url = webkit_glue::WebURLToKURL(ds->request().url()); | 802 KURL url = webkit_glue::WebURLToKURL(ds->request().url()); |
803 if (url.protocolIs(webkit_glue::kBackForwardNavigationScheme)) { | 803 if (url.protocolIs(WebKit::backForwardNavigationScheme)) { |
804 HandleBackForwardNavigation(url); | 804 HandleBackForwardNavigation(url); |
805 navigation_policy = WebKit::WebNavigationPolicyIgnore; | 805 navigation_policy = WebKit::WebNavigationPolicyIgnore; |
806 } else { | 806 } else { |
807 bool is_redirect = ds->hasRedirectChain(); | 807 bool is_redirect = ds->hasRedirectChain(); |
808 | 808 |
809 WebNavigationType webnav_type = | 809 WebNavigationType webnav_type = |
810 WebDataSourceImpl::toWebNavigationType(action.type()); | 810 WebDataSourceImpl::toWebNavigationType(action.type()); |
811 | 811 |
812 RefPtr<WebCore::Node> node; | 812 RefPtr<WebCore::Node> node; |
813 for (const Event* event = action.event(); event; | 813 for (const Event* event = action.event(); event; |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1310 !action.event()->isMouseEvent()) | 1310 !action.event()->isMouseEvent()) |
1311 return false; | 1311 return false; |
1312 | 1312 |
1313 const MouseEvent* event = static_cast<const MouseEvent*>(action.event()); | 1313 const MouseEvent* event = static_cast<const MouseEvent*>(action.event()); |
1314 return WebViewImpl::NavigationPolicyFromMouseEvent(event->button(), | 1314 return WebViewImpl::NavigationPolicyFromMouseEvent(event->button(), |
1315 event->ctrlKey(), event->shiftKey(), event->altKey(), event->metaKey(), | 1315 event->ctrlKey(), event->shiftKey(), event->altKey(), event->metaKey(), |
1316 policy); | 1316 policy); |
1317 } | 1317 } |
1318 | 1318 |
1319 void WebFrameLoaderClient::HandleBackForwardNavigation(const KURL& url) { | 1319 void WebFrameLoaderClient::HandleBackForwardNavigation(const KURL& url) { |
1320 ASSERT(url.protocolIs(webkit_glue::kBackForwardNavigationScheme)); | 1320 ASSERT(url.protocolIs(WebKit::backForwardNavigationScheme)); |
1321 | 1321 |
1322 bool ok; | 1322 bool ok; |
1323 int offset = url.lastPathComponent().toIntStrict(&ok); | 1323 int offset = url.lastPathComponent().toIntStrict(&ok); |
1324 if (!ok) | 1324 if (!ok) |
1325 return; | 1325 return; |
1326 | 1326 |
1327 WebViewImpl* webview = webframe_->GetWebViewImpl(); | 1327 WebViewImpl* webview = webframe_->GetWebViewImpl(); |
1328 if (webview->client()) | 1328 if (webview->client()) |
1329 webview->client()->navigateBackForwardSoon(offset); | 1329 webview->client()->navigateBackForwardSoon(offset); |
1330 } | 1330 } |
1331 | 1331 |
1332 PassOwnPtr<WebPluginLoadObserver> WebFrameLoaderClient::GetPluginLoadObserver()
{ | 1332 PassOwnPtr<WebPluginLoadObserver> WebFrameLoaderClient::GetPluginLoadObserver()
{ |
1333 WebDataSourceImpl* ds = WebDataSourceImpl::fromDocumentLoader( | 1333 WebDataSourceImpl* ds = WebDataSourceImpl::fromDocumentLoader( |
1334 webframe_->frame()->loader()->activeDocumentLoader()); | 1334 webframe_->frame()->loader()->activeDocumentLoader()); |
1335 return ds->releasePluginLoadObserver(); | 1335 return ds->releasePluginLoadObserver(); |
1336 } | 1336 } |
OLD | NEW |