| 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 package org.chromium.components.navigation_interception; | 5 package org.chromium.components.navigation_interception; |
| 6 | 6 |
| 7 import org.chromium.base.CalledByNative; | 7 import org.chromium.base.CalledByNative; |
| 8 | 8 |
| 9 public class NavigationParams { | 9 public class NavigationParams { |
| 10 // Target url of the navigation. | 10 // Target url of the navigation. |
| 11 public final String url; | 11 public final String url; |
| 12 // True if the the navigation method is "POST". | 12 // True if the the navigation method is "POST". |
| 13 public final boolean isPost; | 13 public final boolean isPost; |
| 14 // True if the navigation was initiated by the user. | 14 // True if the navigation was initiated by the user. |
| 15 public final boolean hasUserGesture; | 15 public final boolean hasUserGesture; |
| 16 // Page transition type (e.g. link / typed). | 16 // Page transition type (e.g. link / typed). |
| 17 public final int pageTransitionType; | 17 public final int pageTransitionType; |
| 18 // Is the navigation a redirect (in which case url is the "target" address). | 18 // Is the navigation a redirect (in which case url is the "target" address). |
| 19 public final boolean isRedirect; | 19 public final boolean isRedirect; |
| 20 // True if the target url can't be handled by Chrome's internal protocol han
dlers. | 20 // True if the target url can't be handled by Chrome's internal protocol han
dlers. |
| 21 public final boolean isExternalProtocol; | 21 public final boolean isExternalProtocol; |
| 22 // True if the navigation was orignated from a navigation which had been ini
tiated by the user. | 22 // True if the navigation was orignated from a navigation which had been ini
tiated by the user. |
| 23 public final boolean hasUserGestureCarryover; | 23 public final boolean hasUserGestureCarryover; |
| 24 // True if the navigation was originated from the main frame. |
| 25 public final boolean isMainFrame; |
| 24 | 26 |
| 25 public NavigationParams(String url, boolean isPost, boolean hasUserGesture, | 27 public NavigationParams(String url, boolean isPost, boolean hasUserGesture, |
| 26 int pageTransitionType, boolean isRedirect, boolean isExternalProtoc
ol, | 28 int pageTransitionType, boolean isRedirect, boolean isExternalProtoc
ol, |
| 27 boolean hasUserGestureCarryover) { | 29 boolean isMainFrame, boolean hasUserGestureCarryover) { |
| 28 this.url = url; | 30 this.url = url; |
| 29 this.isPost = isPost; | 31 this.isPost = isPost; |
| 30 this.hasUserGesture = hasUserGesture; | 32 this.hasUserGesture = hasUserGesture; |
| 31 this.pageTransitionType = pageTransitionType; | 33 this.pageTransitionType = pageTransitionType; |
| 32 this.isRedirect = isRedirect; | 34 this.isRedirect = isRedirect; |
| 33 this.isExternalProtocol = isExternalProtocol; | 35 this.isExternalProtocol = isExternalProtocol; |
| 36 this.isMainFrame = isMainFrame; |
| 34 this.hasUserGestureCarryover = hasUserGestureCarryover; | 37 this.hasUserGestureCarryover = hasUserGestureCarryover; |
| 35 } | 38 } |
| 36 | 39 |
| 37 @CalledByNative | 40 @CalledByNative |
| 38 public static NavigationParams create(String url, boolean isPost, boolean ha
sUserGesture, | 41 public static NavigationParams create(String url, boolean isPost, boolean ha
sUserGesture, |
| 39 int pageTransitionType, boolean isRedirect, boolean isExternalProtoc
ol, | 42 int pageTransitionType, boolean isRedirect, boolean isExternalProtoc
ol, |
| 40 boolean hasUserGestureCarryover) { | 43 boolean isMainFrame, boolean hasUserGestureCarryover) { |
| 41 return new NavigationParams(url, isPost, hasUserGesture, pageTransitionT
ype, isRedirect, | 44 return new NavigationParams(url, isPost, hasUserGesture, pageTransitionT
ype, isRedirect, |
| 42 isExternalProtocol, hasUserGestureCarryover); | 45 isExternalProtocol, isMainFrame, hasUserGestureCarryover); |
| 43 } | 46 } |
| 44 } | 47 } |
| OLD | NEW |