Java Code Examples for org.chromium.chrome.browser.tab.Tab#loadIfNeeded()
The following examples show how to use
org.chromium.chrome.browser.tab.Tab#loadIfNeeded() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CompositorViewHolder.java From delion with Apache License 2.0 | 6 votes |
private void setTab(Tab tab) { if (tab != null) tab.loadIfNeeded(); View newView = tab != null ? tab.getView() : null; if (mView == newView) return; // TODO(dtrainor): Look into changing this only if the views differ, but still parse the // ContentViewCore list even if they're the same. updateContentOverlayVisibility(false); if (mTabVisible != tab) { if (mTabVisible != null) mTabVisible.removeObserver(mTabObserver); if (tab != null) tab.addObserver(mTabObserver); } mTabVisible = tab; mView = newView; updateContentOverlayVisibility(mContentOverlayVisiblity); if (mTabVisible != null) initializeTab(mTabVisible); }
Example 2
Source File: CompositorViewHolder.java From AndroidChromium with Apache License 2.0 | 6 votes |
private void setTab(Tab tab) { if (tab != null) tab.loadIfNeeded(); TabContentViewParent newView = tab != null ? tab.getView() : null; if (mView == newView) return; // TODO(dtrainor): Look into changing this only if the views differ, but still parse the // ContentViewCore list even if they're the same. updateContentOverlayVisibility(false); if (mTabVisible != tab) { if (mTabVisible != null) mTabVisible.removeObserver(mTabObserver); if (tab != null) tab.addObserver(mTabObserver); } mTabVisible = tab; mView = newView; updateContentOverlayVisibility(mContentOverlayVisiblity); if (mTabVisible != null) initializeTab(mTabVisible); }
Example 3
Source File: CompositorViewHolder.java From 365browser with Apache License 2.0 | 6 votes |
private void setTab(Tab tab) { if (tab != null) tab.loadIfNeeded(); View newView = tab != null ? tab.getView() : null; if (mView == newView) return; // TODO(dtrainor): Look into changing this only if the views differ, but still parse the // ContentViewCore list even if they're the same. updateContentOverlayVisibility(false); if (mTabVisible != tab) { if (mTabVisible != null) mTabVisible.removeObserver(mTabObserver); if (tab != null) tab.addObserver(mTabObserver); } mTabVisible = tab; mView = newView; updateContentOverlayVisibility(mContentOverlayVisiblity); if (mTabVisible != null) initializeTab(mTabVisible); }
Example 4
Source File: TabModelSelectorImpl.java From delion with Apache License 2.0 | 4 votes |
@Override public void requestToShowTab(Tab tab, TabSelectionType type) { boolean isFromExternalApp = tab != null && tab.getLaunchType() == TabLaunchType.FROM_EXTERNAL_APP; if (mVisibleTab != tab && tab != null && !tab.isNativePage()) { TabModelImpl.startTabSwitchLatencyTiming(type); } if (mVisibleTab != null && mVisibleTab != tab && !mVisibleTab.needsReload()) { if (mVisibleTab.isInitialized() && !mVisibleTab.isDetachedForReparenting()) { // TODO(dtrainor): Once we figure out why we can't grab a snapshot from the current // tab when we have other tabs loading from external apps remove the checks for // FROM_EXTERNAL_APP/FROM_NEW. if (!mVisibleTab.isClosing() && (!isFromExternalApp || type != TabSelectionType.FROM_NEW)) { cacheTabBitmap(mVisibleTab); } mVisibleTab.hide(); mVisibleTab.setFullscreenManager(null); mTabSaver.addTabToSaveQueue(mVisibleTab); } mVisibleTab = null; } if (tab == null) { notifyChanged(); return; } // We hit this case when the user enters tab switcher and comes back to the current tab // without actual tab switch. if (mVisibleTab == tab && !mVisibleTab.isHidden()) { // The current tab might have been killed by the os while in tab switcher. tab.loadIfNeeded(); return; } tab.setFullscreenManager(mActivity.getFullscreenManager()); mVisibleTab = tab; // Don't execute the tab display part if Chrome has just been sent to background. This // avoids uneccessary work (tab restore) and prevents pollution of tab display metrics - see // http://crbug.com/316166. if (type != TabSelectionType.FROM_EXIT) { tab.show(type); mUma.onShowTab(tab.getId(), tab.isBeingRestored()); } }
Example 5
Source File: TabModelSelectorImpl.java From AndroidChromium with Apache License 2.0 | 4 votes |
@Override public void requestToShowTab(Tab tab, TabSelectionType type) { boolean isFromExternalApp = tab != null && tab.getLaunchType() == TabLaunchType.FROM_EXTERNAL_APP; if (mVisibleTab != tab && tab != null && !tab.isNativePage()) { TabModelImpl.startTabSwitchLatencyTiming(type); } if (mVisibleTab != null && mVisibleTab != tab && !mVisibleTab.needsReload()) { if (mVisibleTab.isInitialized() && !mVisibleTab.isDetachedForReparenting()) { // TODO(dtrainor): Once we figure out why we can't grab a snapshot from the current // tab when we have other tabs loading from external apps remove the checks for // FROM_EXTERNAL_APP/FROM_NEW. if (!mVisibleTab.isClosing() && (!isFromExternalApp || type != TabSelectionType.FROM_NEW)) { cacheTabBitmap(mVisibleTab); } mVisibleTab.hide(); mTabSaver.addTabToSaveQueue(mVisibleTab); } mVisibleTab = null; } if (tab == null) { notifyChanged(); return; } // We hit this case when the user enters tab switcher and comes back to the current tab // without actual tab switch. if (mVisibleTab == tab && !mVisibleTab.isHidden()) { // The current tab might have been killed by the os while in tab switcher. tab.loadIfNeeded(); return; } mVisibleTab = tab; // Don't execute the tab display part if Chrome has just been sent to background. This // avoids uneccessary work (tab restore) and prevents pollution of tab display metrics - see // http://crbug.com/316166. if (type != TabSelectionType.FROM_EXIT) { tab.show(type); mUma.onShowTab(tab.getId(), tab.isBeingRestored()); } }
Example 6
Source File: TabModelSelectorImpl.java From 365browser with Apache License 2.0 | 4 votes |
@Override public void requestToShowTab(Tab tab, TabSelectionType type) { boolean isFromExternalApp = tab != null && tab.getLaunchType() == TabLaunchType.FROM_EXTERNAL_APP; if (mVisibleTab != tab && tab != null && !tab.isNativePage()) { TabModelImpl.startTabSwitchLatencyTiming(type); } if (mVisibleTab != null && mVisibleTab != tab && !mVisibleTab.needsReload()) { if (mVisibleTab.isInitialized() && !mVisibleTab.isDetached()) { // TODO(dtrainor): Once we figure out why we can't grab a snapshot from the current // tab when we have other tabs loading from external apps remove the checks for // FROM_EXTERNAL_APP/FROM_NEW. if (!mVisibleTab.isClosing() && (!isFromExternalApp || type != TabSelectionType.FROM_NEW)) { cacheTabBitmap(mVisibleTab); } mVisibleTab.hide(); mTabSaver.addTabToSaveQueue(mVisibleTab); } mVisibleTab = null; } if (tab == null) { notifyChanged(); return; } // We hit this case when the user enters tab switcher and comes back to the current tab // without actual tab switch. if (mVisibleTab == tab && !mVisibleTab.isHidden()) { // The current tab might have been killed by the os while in tab switcher. tab.loadIfNeeded(); return; } mVisibleTab = tab; // Don't execute the tab display part if Chrome has just been sent to background. This // avoids uneccessary work (tab restore) and prevents pollution of tab display metrics - see // http://crbug.com/316166. if (type != TabSelectionType.FROM_EXIT) { tab.show(type); mUma.onShowTab(tab.getId(), tab.isBeingRestored()); } }