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

Side by Side Diff: chrome/browser/chromeos/arc/page_transition_util.cc

Issue 2381403002: Allow the external protocol dialog to handle FORM_SUBMIT navigation (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/browser/chromeos/arc/page_transition_util.h" 5 #include "chrome/browser/chromeos/arc/page_transition_util.h"
6 6
7 namespace arc { 7 namespace arc {
8 8
9 bool ShouldIgnoreNavigation(ui::PageTransition page_transition) { 9 bool ShouldIgnoreNavigation(ui::PageTransition page_transition,
10 bool allow_form_submit) {
10 // Mask out server-sided redirects only. 11 // Mask out server-sided redirects only.
11 page_transition = ui::PageTransitionFromInt( 12 page_transition = ui::PageTransitionFromInt(
12 page_transition & ~ui::PAGE_TRANSITION_SERVER_REDIRECT); 13 page_transition & ~ui::PAGE_TRANSITION_SERVER_REDIRECT);
13 14
14 if (!ui::PageTransitionCoreTypeIs(page_transition, 15 if (!ui::PageTransitionCoreTypeIs(page_transition,
15 ui::PAGE_TRANSITION_LINK)) { 16 ui::PAGE_TRANSITION_LINK) &&
17 !(allow_form_submit &&
18 ui::PageTransitionCoreTypeIs(page_transition,
19 ui::PAGE_TRANSITION_FORM_SUBMIT))) {
16 // Do not handle the |url| if this event wasn't spawned by the user clicking 20 // Do not handle the |url| if this event wasn't spawned by the user clicking
17 // on a link. 21 // on a link.
18 return true; 22 return true;
19 } 23 }
20 24
21 if (ui::PageTransitionGetQualifier(page_transition) != 0) { 25 if (ui::PageTransitionGetQualifier(page_transition) != 0) {
22 // Qualifiers indicate that this navigation was the result of a click on a 26 // Qualifiers indicate that this navigation was the result of a click on a
23 // forward/back button, or typing in the URL bar, or a client-side redirect, 27 // forward/back button, or typing in the URL bar, or a client-side redirect,
24 // etc. Don't handle any of those types of navigations. 28 // etc. Don't handle any of those types of navigations.
25 return true; 29 return true;
26 } 30 }
27 31
28 return false; 32 return false;
29 } 33 }
30 34
31 } // namespace arc 35 } // namespace arc
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/arc/page_transition_util.h ('k') | chrome/browser/chromeos/arc/page_transition_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698