Chromium Code Reviews| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 #include "public/web/WebDOMEvent.h" | 76 #include "public/web/WebDOMEvent.h" |
| 77 #include "public/web/WebDocument.h" | 77 #include "public/web/WebDocument.h" |
| 78 #include "public/web/WebFormElement.h" | 78 #include "public/web/WebFormElement.h" |
| 79 #include "public/web/WebFrameClient.h" | 79 #include "public/web/WebFrameClient.h" |
| 80 #include "public/web/WebNode.h" | 80 #include "public/web/WebNode.h" |
| 81 #include "public/web/WebPermissionClient.h" | 81 #include "public/web/WebPermissionClient.h" |
| 82 #include "public/web/WebPlugin.h" | 82 #include "public/web/WebPlugin.h" |
| 83 #include "public/web/WebPluginParams.h" | 83 #include "public/web/WebPluginParams.h" |
| 84 #include "public/web/WebPluginPlaceholder.h" | 84 #include "public/web/WebPluginPlaceholder.h" |
| 85 #include "public/web/WebSecurityOrigin.h" | 85 #include "public/web/WebSecurityOrigin.h" |
| 86 #include "public/web/WebTransitionElementData.h" | |
| 86 #include "public/web/WebViewClient.h" | 87 #include "public/web/WebViewClient.h" |
| 87 #include "web/PluginPlaceholderImpl.h" | 88 #include "web/PluginPlaceholderImpl.h" |
| 88 #include "web/SharedWorkerRepositoryClientImpl.h" | 89 #include "web/SharedWorkerRepositoryClientImpl.h" |
| 89 #include "web/WebDataSourceImpl.h" | 90 #include "web/WebDataSourceImpl.h" |
| 90 #include "web/WebDevToolsAgentPrivate.h" | 91 #include "web/WebDevToolsAgentPrivate.h" |
| 91 #include "web/WebLocalFrameImpl.h" | 92 #include "web/WebLocalFrameImpl.h" |
| 92 #include "web/WebPluginContainerImpl.h" | 93 #include "web/WebPluginContainerImpl.h" |
| 93 #include "web/WebPluginLoadObserver.h" | 94 #include "web/WebPluginLoadObserver.h" |
| 94 #include "web/WebViewImpl.h" | 95 #include "web/WebViewImpl.h" |
| 95 #include "wtf/StringExtras.h" | 96 #include "wtf/StringExtras.h" |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 471 navigationInfo.extraData = ds->extraData(); | 472 navigationInfo.extraData = ds->extraData(); |
| 472 navigationInfo.navigationType = ds->navigationType(); | 473 navigationInfo.navigationType = ds->navigationType(); |
| 473 navigationInfo.defaultPolicy = static_cast<WebNavigationPolicy>(policy); | 474 navigationInfo.defaultPolicy = static_cast<WebNavigationPolicy>(policy); |
| 474 navigationInfo.isRedirect = ds->isRedirect(); | 475 navigationInfo.isRedirect = ds->isRedirect(); |
| 475 navigationInfo.isTransitionNavigation = isTransitionNavigation; | 476 navigationInfo.isTransitionNavigation = isTransitionNavigation; |
| 476 | 477 |
| 477 WebNavigationPolicy webPolicy = m_webFrame->client()->decidePolicyForNavigat ion(navigationInfo); | 478 WebNavigationPolicy webPolicy = m_webFrame->client()->decidePolicyForNavigat ion(navigationInfo); |
| 478 return static_cast<NavigationPolicy>(webPolicy); | 479 return static_cast<NavigationPolicy>(webPolicy); |
| 479 } | 480 } |
| 480 | 481 |
| 481 void FrameLoaderClientImpl::dispatchAddNavigationTransitionData(const String& al lowedDestinationOrigin, const String& selector, const String& markup) | 482 |
| 483 struct TransitionElementData { | |
| 484 String scope; | |
| 485 String selector; | |
| 486 String markup; | |
| 487 Vector<String> names; | |
| 488 Vector<IntRect> rects; | |
| 489 }; | |
| 490 | |
| 491 void FrameLoaderClientImpl::dispatchAddNavigationTransitionData(const Document:: TransitionElementData& data) | |
| 482 { | 492 { |
| 483 if (m_webFrame->client()) | 493 if (!m_webFrame->client()) |
| 484 m_webFrame->client()->addNavigationTransitionData(allowedDestinationOrig in, selector, markup); | 494 return; |
| 495 | |
| 496 // FIXME(zhenw): change to use WebTransitionElementData after the chrome sid e is done. | |
|
Nate Chapin
2014/11/11 00:28:17
Nit: typically we don't include a specific name on
Zhen Wang
2014/11/11 15:12:20
Done.
| |
| 497 Vector<String> names; | |
| 498 Vector<IntRect> rects; | |
| 499 for (size_t i = 0; i < data.elements.size(); ++i) { | |
| 500 names.append(data.elements[i].name); | |
| 501 rects.append(data.elements[i].rect); | |
| 502 } | |
| 503 m_webFrame->client()->addNavigationTransitionData( | |
| 504 WebString(data.scope), | |
| 505 WebString(data.selector), | |
| 506 WebString(data.markup), | |
| 507 WebVector<WebString>(names), | |
| 508 WebVector<WebRect>(rects)); | |
| 485 } | 509 } |
| 486 | 510 |
| 487 void FrameLoaderClientImpl::dispatchWillRequestResource(FetchRequest* request) | 511 void FrameLoaderClientImpl::dispatchWillRequestResource(FetchRequest* request) |
| 488 { | 512 { |
| 489 if (m_webFrame->client()) { | 513 if (m_webFrame->client()) { |
| 490 WebCachedURLRequest urlRequest(request); | 514 WebCachedURLRequest urlRequest(request); |
| 491 m_webFrame->client()->willRequestResource(m_webFrame, urlRequest); | 515 m_webFrame->client()->willRequestResource(m_webFrame, urlRequest); |
| 492 } | 516 } |
| 493 } | 517 } |
| 494 | 518 |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 860 m_webFrame->client()->didAbortLoading(m_webFrame); | 884 m_webFrame->client()->didAbortLoading(m_webFrame); |
| 861 } | 885 } |
| 862 | 886 |
| 863 void FrameLoaderClientImpl::dispatchDidChangeManifest() | 887 void FrameLoaderClientImpl::dispatchDidChangeManifest() |
| 864 { | 888 { |
| 865 if (m_webFrame->client()) | 889 if (m_webFrame->client()) |
| 866 m_webFrame->client()->didChangeManifest(m_webFrame); | 890 m_webFrame->client()->didChangeManifest(m_webFrame); |
| 867 } | 891 } |
| 868 | 892 |
| 869 } // namespace blink | 893 } // namespace blink |
| OLD | NEW |