Search in sources :

Example 1 with Tab

use of org.chromium.chrome.browser.tab.Tab in project AndroidChromium by JackyAndroid.

the class CompositorViewHolder method internalInit.

private void internalInit() {
    mTabObserver = new EmptyTabObserver() {

        @Override
        public void onContentChanged(Tab tab) {
            CompositorViewHolder.this.onContentChanged();
        }
    };
    mEnableCompositorTabStrip = DeviceFormFactor.isTablet(getContext());
    addOnLayoutChangeListener(new OnLayoutChangeListener() {

        @Override
        public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
            propagateViewportToLayouts(right - left, bottom - top);
            // in so the full page is shown.
            if (mPostHideKeyboardTask != null) {
                new Handler().postDelayed(mPostHideKeyboardTask, 30);
                mPostHideKeyboardTask = null;
            }
        }
    });
    mCompositorView = new CompositorView(getContext(), this);
    // mCompositorView should always be the first child.
    addView(mCompositorView, 0, new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
}
Also used : EmptyTabObserver(org.chromium.chrome.browser.tab.EmptyTabObserver) Tab(org.chromium.chrome.browser.tab.Tab) FrameLayout(android.widget.FrameLayout) Handler(android.os.Handler) SurfaceView(android.view.SurfaceView) View(android.view.View) VirtualView(org.chromium.chrome.browser.compositor.layouts.components.VirtualView) Paint(android.graphics.Paint)

Example 2 with Tab

use of org.chromium.chrome.browser.tab.Tab in project AndroidChromium by JackyAndroid.

the class CompositorViewHolder method onContentChanged.

@Override
public void onContentChanged() {
    if (mTabModelSelector == null) {
        // setTabModelSelector.
        return;
    }
    Tab tab = mTabModelSelector.getCurrentTab();
    setTab(tab);
}
Also used : Tab(org.chromium.chrome.browser.tab.Tab)

Example 3 with Tab

use of org.chromium.chrome.browser.tab.Tab in project AndroidChromium by JackyAndroid.

the class LayerTitleCache method buildUpdatedTitle.

@CalledByNative
private void buildUpdatedTitle(int tabId) {
    if (mTabModelSelector == null)
        return;
    Tab tab = mTabModelSelector.getTabById(tabId);
    if (tab == null)
        return;
    getUpdatedTitle(tab, "");
}
Also used : Tab(org.chromium.chrome.browser.tab.Tab) CalledByNative(org.chromium.base.annotations.CalledByNative)

Example 4 with Tab

use of org.chromium.chrome.browser.tab.Tab in project AndroidChromium by JackyAndroid.

the class LocationBarPhone method updateVisualsForState.

@Override
public void updateVisualsForState() {
    super.updateVisualsForState();
    Tab tab = getCurrentTab();
    boolean isIncognito = tab != null && tab.isIncognito();
    mIncognitoBadge.setVisibility(isIncognito ? VISIBLE : GONE);
    updateIncognitoBadgePadding();
}
Also used : Tab(org.chromium.chrome.browser.tab.Tab)

Example 5 with Tab

use of org.chromium.chrome.browser.tab.Tab in project AndroidChromium by JackyAndroid.

the class LocationBarLayout method backKeyPressed.

private void backKeyPressed() {
    hideSuggestions();
    UiUtils.hideKeyboard(mUrlBar);
    // Revert the URL to match the current page.
    setUrlToPageUrl();
    // Focus the page.
    Tab currentTab = getCurrentTab();
    if (currentTab != null)
        currentTab.requestFocus();
}
Also used : Tab(org.chromium.chrome.browser.tab.Tab)

Aggregations

Tab (org.chromium.chrome.browser.tab.Tab)122 LayoutTab (org.chromium.chrome.browser.compositor.layouts.components.LayoutTab)13 SuppressLint (android.annotation.SuppressLint)10 TabModelSelectorTabObserver (org.chromium.chrome.browser.tabmodel.TabModelSelectorTabObserver)10 LoadUrlParams (org.chromium.content_public.browser.LoadUrlParams)9 TabModel (org.chromium.chrome.browser.tabmodel.TabModel)8 Intent (android.content.Intent)5 FrameLayout (android.widget.FrameLayout)4 EmptyTabObserver (org.chromium.chrome.browser.tab.EmptyTabObserver)4 ContentViewCore (org.chromium.content.browser.ContentViewCore)4 WebContents (org.chromium.content_public.browser.WebContents)4 Activity (android.app.Activity)3 Bitmap (android.graphics.Bitmap)3 Bundle (android.os.Bundle)3 TabLaunchType (org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType)3 PendingIntent (android.app.PendingIntent)2 Context (android.content.Context)2 Handler (android.os.Handler)2 StrictMode (android.os.StrictMode)2 CustomTabsIntent (android.support.customtabs.CustomTabsIntent)2