Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 5451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5462 base::TimeTicks::Now(); | 5462 base::TimeTicks::Now(); |
| 5463 } | 5463 } |
| 5464 } | 5464 } |
| 5465 | 5465 |
| 5466 // PlzNavigate: if the navigation is not synchronous, send it to the browser. | 5466 // PlzNavigate: if the navigation is not synchronous, send it to the browser. |
| 5467 // This includes navigations with no request being sent to the network stack. | 5467 // This includes navigations with no request being sent to the network stack. |
| 5468 if (IsBrowserSideNavigationEnabled() && | 5468 if (IsBrowserSideNavigationEnabled() && |
| 5469 info.urlRequest.checkForBrowserSideNavigation() && | 5469 info.urlRequest.checkForBrowserSideNavigation() && |
| 5470 ShouldMakeNetworkRequestForURL(url)) { | 5470 ShouldMakeNetworkRequestForURL(url)) { |
| 5471 if (info.defaultPolicy == blink::WebNavigationPolicyCurrentTab) { | 5471 if (info.defaultPolicy == blink::WebNavigationPolicyCurrentTab) { |
| 5472 if (RenderThreadImpl::current() && | |
| 5473 RenderThreadImpl::current()->layout_test_mode()) { | |
| 5474 // Layout tests sometimes attempt to load urls of the form | |
| 5475 // about:blank?foo which the browser doesn't expect and will convert to | |
| 5476 // about:blank. Don't send these to the browser. | |
|
Charlie Reis
2017/01/19 22:36:35
Awesome. I love getting rid of checks like this.
| |
| 5477 if (url.SchemeIs(url::kAboutScheme) && url.path() == "blank") | |
| 5478 return info.defaultPolicy; | |
| 5479 } | |
| 5480 | |
| 5481 BeginNavigation(info); | 5472 BeginNavigation(info); |
| 5482 return blink::WebNavigationPolicyHandledByClient; | 5473 return blink::WebNavigationPolicyHandledByClient; |
| 5483 } else { | 5474 } else { |
| 5484 LoadURLExternally(info.urlRequest, info.defaultPolicy); | 5475 LoadURLExternally(info.urlRequest, info.defaultPolicy); |
| 5485 return blink::WebNavigationPolicyIgnore; | 5476 return blink::WebNavigationPolicyIgnore; |
| 5486 } | 5477 } |
| 5487 } | 5478 } |
| 5488 | 5479 |
| 5489 return info.defaultPolicy; | 5480 return info.defaultPolicy; |
| 5490 } | 5481 } |
| (...skipping 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6866 // event target. Potentially a Pepper plugin will receive the event. | 6857 // event target. Potentially a Pepper plugin will receive the event. |
| 6867 // In order to tell whether a plugin gets the last mouse event and which it | 6858 // In order to tell whether a plugin gets the last mouse event and which it |
| 6868 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6859 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
| 6869 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6860 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
| 6870 // |pepper_last_mouse_event_target_|. | 6861 // |pepper_last_mouse_event_target_|. |
| 6871 pepper_last_mouse_event_target_ = nullptr; | 6862 pepper_last_mouse_event_target_ = nullptr; |
| 6872 #endif | 6863 #endif |
| 6873 } | 6864 } |
| 6874 | 6865 |
| 6875 } // namespace content | 6866 } // namespace content |
| OLD | NEW |