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

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

Issue 2348673002: Add an external protocol dialog for ARC (Closed)
Patch Set: Address Xiyuan's comment Created 4 years, 3 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
Index: chrome/browser/chromeos/arc/page_transition_util.cc
diff --git a/chrome/browser/chromeos/arc/page_transition_util.cc b/chrome/browser/chromeos/arc/page_transition_util.cc
new file mode 100644
index 0000000000000000000000000000000000000000..79f6385feafc666d4cd469123c43c439d2069b7f
--- /dev/null
+++ b/chrome/browser/chromeos/arc/page_transition_util.cc
@@ -0,0 +1,32 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/chromeos/arc/page_transition_util.h"
+
+namespace arc {
+
+bool ShouldIgnoreNavigation(ui::PageTransition page_transition) {
+ // Mask out any redirect qualifiers - this method handles navigation from
+ // redirect and non-redirect navigations equivalently.
+ page_transition = ui::PageTransitionFromInt(
+ page_transition & ~ui::PAGE_TRANSITION_IS_REDIRECT_MASK);
+
+ if (!ui::PageTransitionCoreTypeIs(page_transition,
+ ui::PAGE_TRANSITION_LINK)) {
+ // Do not handle the |url| if this event wasn't spawned by the user clicking
+ // on a link.
+ return true;
+ }
+
+ if (ui::PageTransitionGetQualifier(page_transition) != 0) {
+ // Qualifiers indicate that this navigation was the result of a click on a
+ // forward/back button, or typing in the URL bar, etc. Don't handle any of
+ // those types of navigations.
+ return true;
+ }
+
+ return false;
+}
+
+} // namespace arc
« no previous file with comments | « chrome/browser/chromeos/arc/page_transition_util.h ('k') | chrome/browser/chromeos/external_protocol_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698