OLD | NEW |
| (Empty) |
1 // Copyright 2016 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.chrome.browser.navigation; | |
6 | |
7 import org.chromium.content_public.browser.LoadUrlParams; | |
8 import org.chromium.content_public.browser.NavigationController; | |
9 import org.chromium.content_public.browser.NavigationEntry; | |
10 import org.chromium.content_public.browser.NavigationHistory; | |
11 import org.chromium.content_public.browser.WebContents; | |
12 | |
13 /** | |
14 * Provides navigation functionalities for Chrome. It wraps the content layer Na
vigationController | |
15 * and delegates all calls to it. | |
16 */ | |
17 public class TabWebContentsNavigationHandler implements NavigationHandler { | |
18 private NavigationController mNavigationController; | |
19 | |
20 public TabWebContentsNavigationHandler(WebContents webContents) { | |
21 mNavigationController = webContents.getNavigationController(); | |
22 } | |
23 | |
24 @Override | |
25 public boolean canGoBack() { | |
26 return mNavigationController.canGoBack(); | |
27 } | |
28 | |
29 @Override | |
30 public boolean canGoForward() { | |
31 return mNavigationController.canGoForward(); | |
32 } | |
33 | |
34 @Override | |
35 public boolean canGoToOffset(int offset) { | |
36 return mNavigationController.canGoToOffset(offset); | |
37 } | |
38 | |
39 @Override | |
40 public void goToOffset(int offset) { | |
41 mNavigationController.goToOffset(offset); | |
42 } | |
43 | |
44 @Override | |
45 public void goToNavigationIndex(int index) { | |
46 mNavigationController.goToNavigationIndex(index); | |
47 } | |
48 | |
49 @Override | |
50 public void goBack() { | |
51 mNavigationController.goBack(); | |
52 } | |
53 | |
54 @Override | |
55 public void goForward() { | |
56 mNavigationController.goForward(); | |
57 } | |
58 | |
59 @Override | |
60 public boolean isInitialNavigation() { | |
61 return mNavigationController.isInitialNavigation(); | |
62 } | |
63 | |
64 @Override | |
65 public void loadIfNecessary() { | |
66 mNavigationController.loadIfNecessary(); | |
67 } | |
68 | |
69 @Override | |
70 public void requestRestoreLoad() { | |
71 mNavigationController.requestRestoreLoad(); | |
72 } | |
73 | |
74 @Override | |
75 public void reload(boolean checkForRepost) { | |
76 mNavigationController.reload(checkForRepost); | |
77 } | |
78 | |
79 @Override | |
80 public void reloadToRefreshContent(boolean checkForRepost) { | |
81 mNavigationController.reloadToRefreshContent(checkForRepost); | |
82 } | |
83 | |
84 @Override | |
85 public void reloadBypassingCache(boolean checkForRepost) { | |
86 mNavigationController.reloadBypassingCache(checkForRepost); | |
87 } | |
88 | |
89 @Override | |
90 public void reloadDisableLoFi(boolean checkForRepost) { | |
91 mNavigationController.reloadDisableLoFi(checkForRepost); | |
92 } | |
93 | |
94 @Override | |
95 public void cancelPendingReload() { | |
96 mNavigationController.cancelPendingReload(); | |
97 } | |
98 | |
99 @Override | |
100 public void continuePendingReload() { | |
101 mNavigationController.continuePendingReload(); | |
102 } | |
103 | |
104 @Override | |
105 public void loadUrl(LoadUrlParams params) { | |
106 mNavigationController.loadUrl(params); | |
107 } | |
108 | |
109 @Override | |
110 public NavigationHistory getDirectedNavigationHistory(boolean isForward, int
itemLimit) { | |
111 return mNavigationController.getDirectedNavigationHistory(isForward, ite
mLimit); | |
112 } | |
113 | |
114 @Override | |
115 public String getOriginalUrlForVisibleNavigationEntry() { | |
116 return mNavigationController.getOriginalUrlForVisibleNavigationEntry(); | |
117 } | |
118 | |
119 @Override | |
120 public void clearSslPreferences() { | |
121 mNavigationController.clearSslPreferences(); | |
122 } | |
123 | |
124 @Override | |
125 public boolean getUseDesktopUserAgent() { | |
126 return mNavigationController.getUseDesktopUserAgent(); | |
127 } | |
128 | |
129 @Override | |
130 public void setUseDesktopUserAgent(boolean override, boolean reloadOnChange)
{ | |
131 mNavigationController.setUseDesktopUserAgent(override, reloadOnChange); | |
132 } | |
133 | |
134 @Override | |
135 public NavigationEntry getEntryAtIndex(int index) { | |
136 return mNavigationController.getEntryAtIndex(index); | |
137 } | |
138 | |
139 @Override | |
140 public int getLastCommittedEntryIndex() { | |
141 return mNavigationController.getLastCommittedEntryIndex(); | |
142 } | |
143 | |
144 @Override | |
145 public boolean removeEntryAtIndex(int index) { | |
146 return mNavigationController.removeEntryAtIndex(index); | |
147 } | |
148 } | |
OLD | NEW |