NavigationController.java revision 5d1f7b1de12d16ceb2c938c56701a3e8bfa558f7
1// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5package org.chromium.content_public.browser;
6
7/**
8 * The NavigationController Java wrapper to allow communicating with the native
9 * NavigationController object.
10 */
11public interface NavigationController {
12    /**
13     * @return Whether back navigation is possible from the "current entry".
14     */
15    boolean canGoBack();
16
17    /**
18     * @return Whether forward navigation is possible from the "current entry".
19     */
20    boolean canGoForward();
21
22    /**
23     * @param offset The offset into the navigation history.
24     * @return Whether we can move in history by given offset
25     */
26    boolean canGoToOffset(int offset);
27
28    /**
29     * Navigates to the specified offset from the "current entry". Does nothing if the offset is
30     * out of bounds.
31     * @param offset The offset into the navigation history.
32     */
33    void goToOffset(int offset);
34
35    /**
36     * Navigates to the specified index in the navigation entry for this page.
37     * @param index The navigation index to navigate to.
38     */
39    void goToNavigationIndex(int index);
40
41    /**
42     * Goes to the navigation entry before the current one.
43     */
44    void goBack();
45
46    /**
47     * Goes to the navigation entry following the current one.
48     */
49    void goForward();
50}
51