Home | History | Annotate | Download | only in browser

Lines Matching refs:tab

282         // Find out if we will restore any state and remember the tab.
312 // Create an initial tab.
315 // the tab will be close when exit.
317 Tab t = null;
338 List<Tab> tabs = mTabControl.getTabs();
340 for (Tab t : tabs) {
348 // TabControl.restoreState() will create a new tab even if
406 public void onSetWebView(Tab tab, WebView view) {
407 mUi.onSetWebView(tab, view);
411 public void createSubWindow(Tab tab) {
413 WebView mainView = tab.getWebView();
417 mUi.createSubWindow(tab, subView);
458 public List<Tab> getTabs() {
507 final Tab parent = mTabControl.getCurrentTab();
543 Tab tab = (Tab) msg.obj;
544 if (tab != null) {
545 updateScreenshot(tab);
555 public Tab getCurrentTab() {
564 private void shareCurrentPage(Tab tab) {
565 if (tab != null) {
566 sharePage(mActivity, tab.getTitle(),
567 tab.getUrl(), tab.getFavicon(),
568 createScreenshot(tab.getWebView(),
640 Tab tab = mTabControl.getCurrentTab();
641 if (tab != null) {
642 tab.pause();
643 if (!pauseWebViewTimers(tab)) {
698 Tab current = mTabControl.getCurrentTab();
723 * resume all WebView timers using the WebView instance of the given tab
724 * @param tab guaranteed non-null
726 private void resumeWebViewTimers(Tab tab) {
727 boolean inLoad = tab.inPageLoad();
730 WebView w = tab.getWebView();
736 * Pause all WebView timers using the WebView of the given tab
737 * @param tab
738 * @return true if the timers are paused or tab is null
740 private boolean pauseWebViewTimers(Tab tab) {
741 if (tab == null) {
743 } else if (!tab.inPageLoad()) {
759 // Remove the current tab and sub window
760 Tab t = mTabControl.getCurrentTab();
794 Tab t = mTabControl.getCurrentTab();
796 // There is no current tab so we cannot toggle the error console
805 Tab tab = mTabControl.getCurrentTab();
809 mUi.onPageStopped(tab);
820 public void onPageStarted(Tab tab, WebView view, Bitmap favicon) {
827 tab);
841 resumeWebViewTimers(tab);
846 mUi.onTabDataChanged(tab);
848 String url = tab.getUrl();
850 maybeUpdateFavicon(tab, null, url, favicon);
862 public void onPageFinished(Tab tab) {
864 mUi.onTabDataChanged(tab);
868 Performance.onPageFinished(tab.getUrl());
875 public void onProgressChanged(Tab tab) {
876 int newProgress = tab.getLoadProgress();
887 if (tab.inPageLoad()) {
888 updateInLoadMenuItems(mCachedMenu, tab);
889 } else if (mActivityPaused && pauseWebViewTimers(tab)) {
894 if (!tab.isPrivateBrowsingEnabled()
895 && !TextUtils.isEmpty(tab.getUrl())
896 && !tab.isSnapshot()) {
899 // a pending update for the tab.
900 if (tab.shouldUpdateThumbnail() &&
901 (tab.inForeground() && !didUserStopLoading()
902 || !tab.inForeground())) {
903 if (!mHandler.hasMessages(UPDATE_BOOKMARK_THUMBNAIL, tab)) {
905 UPDATE_BOOKMARK_THUMBNAIL, 0, 0, tab),
911 if (!tab.inPageLoad()) {
916 updateInLoadMenuItems(mCachedMenu, tab);
919 mUi.onProgressChanged(tab);
923 public void onUpdatedSecurityState(Tab tab) {
924 mUi.onTabDataChanged(tab);
928 public void onReceivedTitle(Tab tab, final String title) {
929 mUi.onTabDataChanged(tab);
930 final String pageUrl = tab.getOriginalUrl();
936 if (!tab.isPrivateBrowsingEnabled()) {
942 public void onFavicon(Tab tab, WebView view, Bitmap icon) {
943 mUi.onTabDataChanged(tab);
944 maybeUpdateFavicon(tab, view.getOriginalUrl(), view.getUrl(), icon);
948 public boolean shouldOverrideUrlLoading(Tab tab, WebView view, String url) {
949 return mUrlHandler.shouldOverrideUrlLoading(tab, view, url);
976 public void doUpdateVisitedHistory(Tab tab, boolean isReload) {
978 if (tab.isPrivateBrowsingEnabled()) return;
979 String url = tab.getOriginalUrl();
1006 public void onReceivedHttpAuthRequest(Tab tab, WebView view,
1026 if (tab.inForeground() && !handler.suppressDialog()) {
1027 mPageDialogsHandler.showHttpAuthentication(tab, handler, host, realm);
1035 public void onDownloadStart(Tab tab, String url, String userAgent,
1038 WebView w = tab.getWebView();
1042 // This Tab was opened for the sole purpose of downloading a
1044 if (tab == mTabControl.getCurrentTab()) {
1045 // In this case, the Tab is still on top.
1049 closeTab(tab);
1071 public void showAutoLogin(Tab tab) {
1072 assert tab.inForeground();
1074 mUi.showAutoLogin(tab);
1078 public void hideAutoLogin(Tab tab) {
1079 assert tab.inForeground();
1080 mUi.hideAutoLogin(tab);
1089 private void maybeUpdateFavicon(Tab tab, final String originalUrl,
1094 if (!tab.isPrivateBrowsingEnabled()) {
1101 public void bookmarkedStatusHasChanged(Tab tab) {
1103 mUi.bookmarkedStatusHasChanged(tab);
1124 public void showCustomView(Tab tab, View view, int requestedOrientation,
1126 if (tab.inForeground()) {
1184 Tab t = getCurrentTab();
1190 Tab parent = getCurrentTab();
1202 Toast.makeText(mActivity, "Snapshot Tab requires WebViewClassic",
1225 * @param startWithHistory If true, open starting on the history tab.
1226 * Otherwise, start with the bookmarks tab.
1376 // decide whether to show the open link in new tab option
1406 final Tab parent = mTabControl.getCurrentTab();
1464 private void updateInLoadMenuItems(Menu menu, Tab tab) {
1469 MenuItem src = ((tab != null) && tab.inPageLoad()) ?
1509 public void updateMenuState(Tab tab, Menu menu) {
1515 if (tab != null) {
1516 canGoBack = tab.canGoBack();
1517 canGoForward = tab.canGoForward();
1518 isHome = mSettings.getHomePage().equals(tab.getUrl());
1519 isDesktopUa = mSettings.hasDesktopUseragent(tab.getWebView());
1520 isLive = !tab.isSnapshot();
1560 mUi.updateMenuState(tab, menu);
1639 Tab current = mTabControl.getCurrentTab();
1652 final Tab source = getTabControl().getCurrentTab();
1666 Tab currentTab = mTabControl.getCurrentTab();
1705 Tab desiredTab = mTabControl.getTab(id);
1725 private Tab mTab;
1729 private SaveSnapshotTask(Tab tab) {
1730 mTab = tab;
1814 Tab t = getCurrentTab();
1978 final Tab tab = getCurrentTab();
1979 return (tab != null) && tab.inPageLoad();
2096 private void updateScreenshot(Tab tab) {
2102 WebView view = tab.getWebView();
2104 // Tab was destroyed
2107 final String url = tab.getUrl();
2116 if (!Patterns.WEB_URL.matcher(url).matches() && !tab.isBookmarkedSite()) {
2278 // basic tab interactions:
2280 // it is assumed that tabcontrol already knows about the tab
2281 protected void addTab(Tab tab) {
2282 mUi.addTab(tab);
2285 protected void removeTab(Tab tab) {
2286 mUi.removeTab(tab);
2287 mTabControl.removeTab(tab);
2292 public void setActiveTab(Tab tab) {
2294 if (tab != null) {
2295 mTabControl.setCurrentTab(tab);
2296 // the tab is guaranteed to have a webview after setCurrentTab
2297 mUi.setActiveTab(tab);
2302 Tab current = mTabControl.getCurrentTab();
2309 protected void reuseTab(Tab appTab, UrlData urlData) {
2323 // If the tab was the current tab, we have to attach
2333 public void dismissSubWindow(Tab tab) {
2334 removeSubWindow(tab);
2336 tab.dismissSubWindow();
2344 public void removeSubWindow(Tab t) {
2351 public void attachSubWindow(Tab tab) {
2352 if (tab.getSubWebView() != null) {
2353 mUi.attachSubWindow(tab.getSubViewContainer());
2358 private Tab showPreloadedTab(final UrlData urlData) {
2366 // Could not submit query. Fallback to regular tab creation
2371 // check tab count and make room for new tab
2373 Tab leastUsed = mTabControl.getLeastUsedTab(getCurrentTab());
2378 Tab t = tabControl.getTab();
2386 // open a non inconito tab with the given url data
2387 // and set as active tab
2388 public Tab openTab(UrlData urlData) {
2389 Tab tab = showPreloadedTab(urlData);
2390 if (tab == null) {
2391 tab = createNewTab(false, true, true);
2392 if ((tab != null) && !urlData.isEmpty()) {
2393 loadUrlDataIn(tab, urlData);
2396 return tab;
2400 public Tab openTabToHomePage() {
2405 public Tab openIncognitoTab() {
2410 public Tab openTab(String url, boolean incognito, boolean setActive,
2416 public Tab openTab(String url, Tab parent, boolean setActive,
2422 public Tab openTab(String url, boolean incognito, boolean setActive,
2423 boolean useCurrent, Tab parent) {
2424 Tab tab = createNewTab(incognito, setActive, useCurrent);
2425 if (tab != null) {
2426 if (parent != null && parent != tab) {
2427 parent.addChildTab(tab);
2430 loadUrl(tab, url);
2433 return tab;
2436 // this method will attempt to create a new tab
2437 // incognito: private browsing tab
2438 // setActive: ste tab as current tab
2439 // useCurrent: if no new tab can be created, return current tab
2440 private Tab createNewTab(boolean incognito, boolean setActive,
2442 Tab tab = null;
2444 tab = mTabControl.createNewTab(incognito);
2445 addTab(tab);
2447 setActiveTab(tab);
2451 tab = mTabControl.getCurrentTab();
2452 reuseTab(tab, null);
2457 return tab;
2462 SnapshotTab tab = null;
2464 tab = mTabControl.createSnapshotTab(snapshotId);
2465 addTab(tab);
2467 setActiveTab(tab);
2472 return tab;
2476 * @param tab the tab to switch to
2477 * @return boolean True if we successfully switched to a different tab. If
2478 * the indexth tab is null, or if that tab is the same as
2482 public boolean switchToTab(Tab tab) {
2483 Tab currentTab = mTabControl.getCurrentTab();
2484 if (tab == null || tab == currentTab) {
2487 setActiveTab(tab);
2503 final Tab current = mTabControl.getCurrentTab();
2505 Tab newTab = current.getParent();
2522 * Close the tab, remove its associated title bar, and adjust mTabControl's
2523 * current tab to a valid value.
2526 public void closeTab(Tab tab) {
2527 if (tab == mTabControl.getCurrentTab()) {
2530 removeTab(tab);
2541 Tab tab = mTabControl.getTab(i);
2542 if (tab != mTabControl.getCurrentTab()) {
2543 removeTab(tab);
2550 Tab tab = getCurrentTab();
2551 WebView view = tab != null ? tab.getWebView() : null;
2553 if (url != null && url.length() != 0 && tab != null && view != null) {
2557 loadUrl(tab, url);
2570 public void loadUrl(Tab tab, String url) {
2571 loadUrl(tab, url, null);
2574 protected void loadUrl(Tab tab, String url, Map<String, String> headers) {
2575 if (tab != null) {
2576 dismissSubWindow(tab);
2577 tab.loadUrl(url, headers);
2578 mUi.onProgressChanged(tab);
2583 * Load UrlData into a Tab and update the title bar to reflect the new
2585 * @param t The Tab used to load.
2588 protected void loadUrlDataIn(Tab t, UrlData data) {
2602 public void onUserCanceledSsl(Tab tab) {
2604 if (tab.canGoBack()) {
2605 tab.goBack();
2607 tab.loadUrl(mSettings.getHomePage(), null);
2612 Tab current = mTabControl.getCurrentTab();
2629 Tab parent = current.getParent();
2632 // Now we close the other tab
2652 * returns the current tab if it can't advance
2654 private Tab getNextTab() {
2664 * returns the current tab if it can't advance
2666 private Tab getPrevTab() {
2698 Tab tab = getCurrentTab();
2699 if (webView == null || tab == null) return false;
2708 // prev tab
2711 // next tab
2733 tab.goForward();
2737 tab.goBack();
2743 tab.goForward();