Chromium Code Reviews| Index: chrome/browser/chromeos/arc/arc_navigation_throttle.cc |
| diff --git a/chrome/browser/chromeos/arc/arc_navigation_throttle.cc b/chrome/browser/chromeos/arc/arc_navigation_throttle.cc |
| index 93131e18347c362bde6d5e6e1a02086bee645461..2caccf5c3a02ecfbd4b8ca1cad21e80b63445850 100644 |
| --- a/chrome/browser/chromeos/arc/arc_navigation_throttle.cc |
| +++ b/chrome/browser/chromeos/arc/arc_navigation_throttle.cc |
| @@ -16,6 +16,7 @@ |
| #include "content/public/browser/browser_thread.h" |
| #include "content/public/browser/navigation_handle.h" |
| #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
| +#include "ui/base/page_transition_types.h" |
| namespace arc { |
| @@ -63,11 +64,26 @@ ArcNavigationThrottle::~ArcNavigationThrottle() = default; |
| content::NavigationThrottle::ThrottleCheckResult |
| ArcNavigationThrottle::WillStartRequest() { |
| DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| - if (!navigation_handle()->HasUserGesture()) |
| + |
| + const ui::PageTransition transition = |
| + navigation_handle()->GetPageTransition(); |
| + |
| + if (!ui::PageTransitionCoreTypeIs(transition, ui::PAGE_TRANSITION_LINK)) { |
| + // If this navigation event wasn't spawned by the user clicking on a link. |
| return content::NavigationThrottle::PROCEED; |
| + } |
| - if (!ShouldOverrideUrlLoading(navigation_handle())) |
| + if (ui::PageTransitionGetQualifier(transition) != 0) { |
| + // Qualifiers indicate that this navigation was the result of a click on a |
| + // forward/back button, or a redirect, or typing in the URL bar, etc. Don't |
| + // pass any of those types of navigations to the intent helper (but see |
| + // b/29250054). |
|
Luis Héctor Chávez
2016/07/22 19:08:18
Can you put all the accumulated knowledge in crbug
Ben Kwa
2016/07/22 20:16:43
Done.
|
| return content::NavigationThrottle::PROCEED; |
| + } |
| + |
| + if (!ShouldOverrideUrlLoading(navigation_handle())) { |
| + return content::NavigationThrottle::PROCEED; |
|
Luis Héctor Chávez
2016/07/22 19:08:18
nit: remove the braces to see if the diff becomes
Ben Kwa
2016/07/22 20:16:43
Done.
|
| + } |
| const GURL& url = navigation_handle()->GetURL(); |
| mojom::IntentHelperInstance* bridge_instance = GetIntentHelper(); |