Lines Matching refs:Tab
40 private ArrayList<Tab> mTabs = new ArrayList<Tab>(MAX_TABS);
42 private ArrayList<Tab> mTabQueue = new ArrayList<Tab>(MAX_TABS);
71 * Return the current tab's main WebView. This will always return the main
72 * WebView for a given tab and not a subwindow.
73 * @return The current tab's WebView.
76 Tab t = getTab(mCurrentTab);
84 * Return the current tab's top-level WebView. This can return a subwindow
86 * @return The top-level WebView of the current tab.
89 Tab t = getTab(mCurrentTab);
97 * Return the current tab's subwindow if it exists.
98 * @return The subwindow of the current tab or null if it doesn't exist.
101 Tab t = getTab(mCurrentTab);
109 * Return the tab at the specified index.
110 * @return The Tab for the specified index or null if the tab does not
113 Tab getTab(int index) {
121 * Return the current tab.
122 * @return The current tab.
124 Tab getCurrentTab() {
129 * Return the current tab index.
130 * @return The current tab index
137 * Given a Tab, find it's index
138 * @param Tab to find
139 * @return index of Tab or -1 if not found
141 int getTabIndex(Tab tab) {
142 if (tab == null) {
145 return mTabs.indexOf(tab);
153 * Create a new tab.
157 Tab createNewTab(boolean closeOnExit, String appId, String url) {
165 // Create a new tab and add it to the tab list
166 Tab t = new Tab(mActivity, w, closeOnExit, appId, url);
168 // Initially put the tab in the background.
174 * Create a new tab with default values for closeOnExit(false),
177 Tab createNewTab() {
185 for (Tab tab : mTabs) {
186 tab.removeFromTree();
191 * Remove the tab from the list. If the tab is the current tab shown, the
192 * last created tab will be shown.
193 * @param t The tab to be removed.
195 boolean removeTab(Tab t) {
200 // Grab the current tab before modifying the list.
201 Tab current = getCurrentTab();
206 // Put the tab in the background only if it is the current one.
211 // If a tab that is earlier in the list gets removed, the current
212 // index no longer points to the correct tab.
216 // destroy the tab
221 // The tab indices have shifted, update all the saved state so we point
223 for (Tab tab : mTabs) {
224 Vector<Tab> children = tab.getChildTabs();
226 for (Tab child : children) {
227 child.setParentTab(tab);
232 // This tab may have been pushed in to the background and then closed.
236 if (savedState.containsKey(Tab.CURRPICTURE)) {
237 new File(savedState.getString(Tab.CURRPICTURE)).delete();
250 for (Tab t : mTabs) {
272 outState.putInt(Tab.NUMTABS, numTabs);
274 outState.putInt(Tab.CURRTAB, (index >= 0 && index < numTabs) ? index : 0);
276 final Tab t = getTab(i);
278 outState.putBundle(Tab.WEBVIEW + i, t.getSavedState());
291 ? -1 : inState.getInt(Tab.NUMTABS, -1);
295 final int currentTab = inState.getInt(Tab.CURRTAB, -1);
298 Tab t = createNewTab();
299 // Me must set the current tab before restoring the state
302 if (!t.restoreState(inState.getBundle(Tab.WEBVIEW + i))) {
308 // Create a new tab and don't restore the state yet, add it
309 // to the tab list
310 Tab t = new Tab(mActivity, null, false, null, null);
311 Bundle state = inState.getBundle(Tab.WEBVIEW + i);
316 // can possibly reuse this tab.
317 t.setAppId(state.getString(Tab.APPID));
318 t.setOriginalUrl(state.getString(Tab.ORIGINALURL));
321 // added the tab to the front as they are not current
326 // created/restored so that the parent tab exists.
328 final Bundle b = inState.getBundle(Tab.WEBVIEW + i);
329 final Tab t = getTab(i);
331 final int parentIndex = b.getInt(Tab.PARENTTAB, -1);
333 final Tab parent = getTab(parentIndex);
352 Vector<Tab> tabs = getHalfLeastUsedTabs(getCurrentTab());
355 for (Tab t : tabs) {
358 // destroy the tab
372 private Vector<Tab> getHalfLeastUsedTabs(Tab current) {
373 Vector<Tab> tabsToGo = new Vector<Tab>();
375 // Don't do anything if we only have 1 tab or if the current tab is
386 // available tabs which are not the current tab or the parent of the
387 // current tab.
389 for (Tab t : mTabQueue) {
407 * Show the tab that contains the given WebView.
408 * @param view The WebView used to find the tab.
410 Tab getTabFromView(WebView view) {
413 final Tab t = getTab(i);
422 * Return the tab with the matching application id.
425 Tab getTabFromId(String id) {
431 final Tab t = getTab(i);
445 final Tab t = getTab(i);
457 // This method checks if a non-app tab (one created within the browser)
459 private boolean tabMatchesUrl(Tab t, String url) {
474 * Return the tab that has no app id associated with it and the url of the
475 * tab matches the given url.
478 Tab findUnusedTabWithUrl(String url) {
482 // Check the current tab first.
483 Tab t = getCurrentTab();
499 * Recreate the main WebView of the given tab. Returns true if the WebView
503 boolean recreateWebView(Tab t, BrowserActivity.UrlData urlData) {
523 // Create a new WebView. If this tab is the current tab, we need to put
524 // back all the clients so force it to be the current tab.
568 * Put the current tab in the background and set newTab as the current tab.
569 * @param newTab The new tab. If newTab is null, the current tab is not
572 boolean setCurrentTab(Tab newTab) {
577 Tab t = getCurrentTab();
584 Tab t = getCurrentTab();
593 private boolean setCurrentTab(Tab newTab, boolean force) {
594 Tab current = getTab(mCurrentTab);
613 // Display the new current tab
618 // Same work as in createNewTab() except don't do new Tab()