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 */ canGoBack()15 boolean canGoBack(); 16 17 /** 18 * @return Whether forward navigation is possible from the "current entry". 19 */ canGoForward()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 */ canGoToOffset(int offset)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 */ goToOffset(int offset)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 */ goToNavigationIndex(int index)39 void goToNavigationIndex(int index); 40 41 /** 42 * Goes to the navigation entry before the current one. 43 */ goBack()44 void goBack(); 45 46 /** 47 * Goes to the navigation entry following the current one. 48 */ goForward()49 void goForward(); 50 } 51