Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6480)

Unified Diff: chrome/browser/chromeos/arc/arc_navigation_throttle.cc

Issue 2165193002: [arc-intents] Adjust link-click detection code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use page transition API Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5b528eb93d12599cc376e8293e22d7dfb6751e7f 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,8 +64,11 @@ ArcNavigationThrottle::~ArcNavigationThrottle() = default;
content::NavigationThrottle::ThrottleCheckResult
ArcNavigationThrottle::WillStartRequest() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- if (!navigation_handle()->HasUserGesture())
+ if (ui::PageTransitionCoreTypeIs(navigation_handle()->GetPageTransition(),
+ ui::PAGE_TRANSITION_LINK)) {
+ // If this navigation event wasn't spawned by the user clicking on a link.
Luis Héctor Chávez 2016/07/22 15:35:34 nit: was spawned? From the PAGE_TRANSITION_LINK c
Ben Kwa 2016/07/22 17:58:06 Egads. Sorry, this page transition code is confus
return content::NavigationThrottle::PROCEED;
+ }
if (!ShouldOverrideUrlLoading(navigation_handle()))
return content::NavigationThrottle::PROCEED;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698