Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / content / public / android / java / src / org / chromium / content_public / browser / NavigationController.java
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
5 package org.chromium.content_public.browser;
6
7 /**
8  * The NavigationController Java wrapper to allow communicating with the native
9  * NavigationController object.
10  */
11 public 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     /**
52      * Loads the current navigation if there is a pending lazy load (after tab restore).
53      */
54     public void loadIfNecessary();
55
56     /**
57      * Requests the current navigation to be loaded upon the next call to loadIfNecessary().
58      */
59     public void requestRestoreLoad();
60
61     /**
62      * Reload the current page.
63      */
64     public void reload(boolean checkForRepost);
65
66     /**
67      * Reload the current page, ignoring the contents of the cache.
68      */
69     public void reloadIgnoringCache(boolean checkForRepost);
70
71     /**
72      * Cancel the pending reload.
73      */
74     public void cancelPendingReload();
75
76     /**
77      * Continue the pending reload.
78      */
79     public void continuePendingReload();
80 }