// Copyright (c) 2013 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.

package org.chromium.components.navigation_interception;

import org.chromium.base.CalledByNative;

public class NavigationParams {
    // Target url of the navigation.
    public final String url;
    // True if the the navigation method is "POST".
    public final boolean isPost;
    // True if the navigation was initiated by the user.
    public final boolean hasUserGesture;
    // Page transition type (e.g. link / typed).
    public final int pageTransitionType;
    // Is the navigation a redirect (in which case url is the "target" address).
    public final boolean isRedirect;

    public NavigationParams(String url, boolean isPost, boolean hasUserGesture,
            int pageTransitionType, boolean isRedirect) {
        this.url = url;
        this.isPost = isPost;
        this.hasUserGesture = hasUserGesture;
        this.pageTransitionType = pageTransitionType;
        this.isRedirect = isRedirect;
    }

    @CalledByNative
    public static NavigationParams create(String url, boolean isPost, boolean hasUserGesture,
            int pageTransitionType, boolean isRedirect) {
        return new NavigationParams(url, isPost, hasUserGesture, pageTransitionType,
                isRedirect);
    }
}

Add param struct to navigation interception Java code.
[android] Add param struct to navigation interception Java code.

This is a prerequisite to refactoring the navigation interception
Java code to use a class to pass around parameters.

TBR=jknotten@chromium.org
BUG=None
TESTS=components_unittests,AndroidWebViewTests
NOTRY=true


Review URL: https://chromiumcodereview.appspot.com/12095061

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@179669 0039d316-1c4b-4281-b951-d872f2087c98
