org.chromium.chrome.browser.tabmodel.TabCreatorManager Java Examples
The following examples show how to use
org.chromium.chrome.browser.tabmodel.TabCreatorManager.
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 |
/** * Sets the appropriate objects this class should represent. * @param tabModelSelector The {@link TabModelSelector} this View should hold and * represent. * @param tabCreatorManager The {@link TabCreatorManager} for this view. * @param tabContentManager The {@link TabContentManager} for the tabs. * @param androidContentContainer The {@link ViewGroup} the {@link LayoutManager} should bind * Android content to. * @param contextualSearchManager A {@link ContextualSearchManagementDelegate} instance. * @param readerModeManager A {@link ReaderModeManagerDelegate} instance. */ public void onFinishNativeInitialization(TabModelSelector tabModelSelector, TabCreatorManager tabCreatorManager, TabContentManager tabContentManager, ViewGroup androidContentContainer, ContextualSearchManagementDelegate contextualSearchManager, ReaderModeManagerDelegate readerModeManager) { assert mLayoutManager != null; mLayoutManager.init(tabModelSelector, tabCreatorManager, tabContentManager, androidContentContainer, contextualSearchManager, readerModeManager, mCompositorView.getResourceManager().getDynamicResourceLoader()); mTabModelSelector = tabModelSelector; tabModelSelector.addObserver(new EmptyTabModelSelectorObserver() { @Override public void onChange() { onContentChanged(); } @Override public void onNewTabCreated(Tab tab) { initializeTab(tab); } }); onContentChanged(); }
Example #2
Source File: LayoutManagerDocumentTabSwitcher.java From delion with Apache License 2.0 | 6 votes |
@Override public void init(TabModelSelector selector, TabCreatorManager creator, TabContentManager content, ViewGroup androidContentContainer, ContextualSearchManagementDelegate contextualSearchDelegate, ReaderModeManagerDelegate readerModeManagerDelegate, DynamicResourceLoader dynamicResourceLoader) { super.init(selector, creator, content, androidContentContainer, contextualSearchDelegate, readerModeManagerDelegate, dynamicResourceLoader); mTitleCache = mHost.getTitleCache(); TabModelSelector documentTabSelector = ChromeApplication.getDocumentTabModelSelector(); mOverviewListLayout.setTabModelSelector(documentTabSelector, content); mOverviewLayout.setTabModelSelector(documentTabSelector, content); // TODO(changwan): do we really need this? startShowing(getDefaultLayout(), false); }
Example #3
Source File: DocumentTabModelImpl.java From 365browser with Apache License 2.0 | 6 votes |
/** * Construct a DocumentTabModel. * @param activityDelegate Delegate to use for accessing the ActivityManager. * @param storageDelegate Delegate to use for accessing persistent storage. * @param tabCreatorManager Used to create Tabs. * @param isIncognito Whether or not the TabList is managing incognito tabs. * @param prioritizedTabId ID of the tab to prioritize when loading. * @param context Context to use for accessing SharedPreferences. */ public DocumentTabModelImpl(ActivityDelegate activityDelegate, StorageDelegate storageDelegate, TabCreatorManager tabCreatorManager, boolean isIncognito, int prioritizedTabId, Context context) { super(isIncognito, false); mActivityDelegate = activityDelegate; mStorageDelegate = storageDelegate; mContext = context; mCurrentState = STATE_UNINITIALIZED; mTabIdList = new ArrayList<Integer>(); mEntryMap = new SparseArray<Entry>(); mHistoricalTabs = new ArrayList<Integer>(); mLastShownTabId = DocumentUtils.getLastShownTabIdFromPrefs(mContext, isIncognito()); // Restore the tab list. setCurrentState(STATE_READ_RECENT_TASKS_START); mStorageDelegate.restoreTabEntries( isIncognito, activityDelegate, mEntryMap, mTabIdList, mHistoricalTabs); setCurrentState(STATE_READ_RECENT_TASKS_END); }
Example #4
Source File: DocumentTabModelImpl.java From delion with Apache License 2.0 | 6 votes |
/** * Construct a DocumentTabModel. * @param activityDelegate Delegate to use for accessing the ActivityManager. * @param storageDelegate Delegate to use for accessing persistent storage. * @param tabCreatorManager Used to create Tabs. * @param isIncognito Whether or not the TabList is managing incognito tabs. * @param prioritizedTabId ID of the tab to prioritize when loading. * @param context Context to use for accessing SharedPreferences. */ public DocumentTabModelImpl(ActivityDelegate activityDelegate, StorageDelegate storageDelegate, TabCreatorManager tabCreatorManager, boolean isIncognito, int prioritizedTabId, Context context) { super(isIncognito); mActivityDelegate = activityDelegate; mStorageDelegate = storageDelegate; mContext = context; mCurrentState = STATE_UNINITIALIZED; mTabIdList = new ArrayList<Integer>(); mEntryMap = new SparseArray<Entry>(); mHistoricalTabs = new ArrayList<Integer>(); mLastShownTabId = DocumentUtils.getLastShownTabIdFromPrefs(mContext, isIncognito()); // Restore the tab list. setCurrentState(STATE_READ_RECENT_TASKS_START); mStorageDelegate.restoreTabEntries( isIncognito, activityDelegate, mEntryMap, mTabIdList, mHistoricalTabs); setCurrentState(STATE_READ_RECENT_TASKS_END); }
Example #5
Source File: DocumentTabModelImpl.java From AndroidChromium with Apache License 2.0 | 6 votes |
/** * Construct a DocumentTabModel. * @param activityDelegate Delegate to use for accessing the ActivityManager. * @param storageDelegate Delegate to use for accessing persistent storage. * @param tabCreatorManager Used to create Tabs. * @param isIncognito Whether or not the TabList is managing incognito tabs. * @param prioritizedTabId ID of the tab to prioritize when loading. * @param context Context to use for accessing SharedPreferences. */ public DocumentTabModelImpl(ActivityDelegate activityDelegate, StorageDelegate storageDelegate, TabCreatorManager tabCreatorManager, boolean isIncognito, int prioritizedTabId, Context context) { super(isIncognito, false); mActivityDelegate = activityDelegate; mStorageDelegate = storageDelegate; mContext = context; mCurrentState = STATE_UNINITIALIZED; mTabIdList = new ArrayList<Integer>(); mEntryMap = new SparseArray<Entry>(); mHistoricalTabs = new ArrayList<Integer>(); mLastShownTabId = DocumentUtils.getLastShownTabIdFromPrefs(mContext, isIncognito()); // Restore the tab list. setCurrentState(STATE_READ_RECENT_TASKS_START); mStorageDelegate.restoreTabEntries( isIncognito, activityDelegate, mEntryMap, mTabIdList, mHistoricalTabs); setCurrentState(STATE_READ_RECENT_TASKS_END); }
Example #6
Source File: StripLayoutHelperManager.java From delion with Apache License 2.0 | 5 votes |
/** * Sets the {@link TabModelSelector} that this {@link StripLayoutHelperManager} will visually * represent, and various objects associated with it. * @param modelSelector The {@link TabModelSelector} to visually represent. * @param tabCreatorManager The {@link TabCreatorManager}, used to create new tabs. */ public void setTabModelSelector(TabModelSelector modelSelector, TabCreatorManager tabCreatorManager) { if (mTabModelSelector == modelSelector) return; mTabModelSelector = modelSelector; mNormalHelper.setTabModel(mTabModelSelector.getModel(false), tabCreatorManager.getTabCreator(false)); mIncognitoHelper.setTabModel(mTabModelSelector.getModel(true), tabCreatorManager.getTabCreator(true)); tabModelSwitched(mTabModelSelector.isIncognitoSelected()); }
Example #7
Source File: ChromeActivity.java From 365browser with Apache License 2.0 | 5 votes |
@Override public TabCreatorManager.TabCreator getTabCreator(boolean incognito) { if (!mTabModelsInitialized) { throw new IllegalStateException( "Attempting to access TabCreator before initialization"); } return incognito ? mIncognitoTabCreator : mRegularTabCreator; }
Example #8
Source File: CustomTabLayoutManager.java From 365browser with Apache License 2.0 | 5 votes |
@Override public void init(TabModelSelector selector, TabCreatorManager creator, TabContentManager content, ViewGroup androidContentContainer, ContextualSearchManagementDelegate contextualSearchDelegate, ReaderModeManagerDelegate readerModeDelegate, DynamicResourceLoader dynamicResourceLoader) { super.init(selector, creator, content, androidContentContainer, contextualSearchDelegate, readerModeDelegate, dynamicResourceLoader); for (TabModel model : selector.getModels()) model.addObserver(mTabModelObserver); }
Example #9
Source File: ReaderModeManager.java From 365browser with Apache License 2.0 | 5 votes |
/** * Open a link from the panel in a new tab. * @param url The URL to load. */ @Override public void createNewTab(String url) { if (mChromeActivity == null) return; Tab currentTab = mTabModelSelector.getCurrentTab(); if (currentTab == null) return; TabCreatorManager.TabCreator tabCreator = mChromeActivity.getTabCreator(currentTab.isIncognito()); if (tabCreator == null) return; tabCreator.createNewTab(new LoadUrlParams(url, PageTransition.LINK), TabModel.TabLaunchType.FROM_LINK, mChromeActivity.getActivityTab()); }
Example #10
Source File: LayoutManager.java From 365browser with Apache License 2.0 | 5 votes |
/** * Initializes the {@link LayoutManager}. Must be called before using this object. * @param selector A {@link TabModelSelector} instance. * @param creator A {@link TabCreatorManager} instance. * @param content A {@link TabContentManager} instance. * @param androidContentContainer A {@link ViewGroup} for Android views to be bound to. * @param contextualSearchDelegate A {@link ContextualSearchDelegate} instance. * @param readerModeDelegate A {@link ReaderModeManagerDelegate} instance. * @param dynamicResourceLoader A {@link DynamicResourceLoader} instance. */ public void init(TabModelSelector selector, TabCreatorManager creator, TabContentManager content, ViewGroup androidContentContainer, ContextualSearchManagementDelegate contextualSearchDelegate, ReaderModeManagerDelegate readerModeDelegate, DynamicResourceLoader dynamicResourceLoader) { mTabModelSelector = selector; mContentContainer = androidContentContainer; if (mNextActiveLayout != null) startShowing(mNextActiveLayout, true); updateLayoutForTabModelSelector(); }
Example #11
Source File: LayoutManagerChromePhone.java From 365browser with Apache License 2.0 | 5 votes |
@Override public void init(TabModelSelector selector, TabCreatorManager creator, TabContentManager content, ViewGroup androidContentContainer, ContextualSearchManagementDelegate contextualSearchDelegate, ReaderModeManagerDelegate readerModeDelegate, DynamicResourceLoader dynamicResourceLoader) { // Initialize Layouts mSimpleAnimationLayout.setTabModelSelector(selector, content); super.init(selector, creator, content, androidContentContainer, contextualSearchDelegate, readerModeDelegate, dynamicResourceLoader); }
Example #12
Source File: StripLayoutHelperManager.java From 365browser with Apache License 2.0 | 5 votes |
/** * Sets the {@link TabModelSelector} that this {@link StripLayoutHelperManager} will visually * represent, and various objects associated with it. * @param modelSelector The {@link TabModelSelector} to visually represent. * @param tabCreatorManager The {@link TabCreatorManager}, used to create new tabs. */ public void setTabModelSelector(TabModelSelector modelSelector, TabCreatorManager tabCreatorManager) { if (mTabModelSelector == modelSelector) return; mTabModelSelector = modelSelector; mNormalHelper.setTabModel(mTabModelSelector.getModel(false), tabCreatorManager.getTabCreator(false)); mIncognitoHelper.setTabModel(mTabModelSelector.getModel(true), tabCreatorManager.getTabCreator(true)); tabModelSwitched(mTabModelSelector.isIncognitoSelected()); }
Example #13
Source File: CompositorViewHolder.java From 365browser with Apache License 2.0 | 5 votes |
/** * Sets the appropriate objects this class should represent. * @param tabModelSelector The {@link TabModelSelector} this View should hold and * represent. * @param tabCreatorManager The {@link TabCreatorManager} for this view. * @param tabContentManager The {@link TabContentManager} for the tabs. * @param androidContentContainer The {@link ViewGroup} the {@link LayoutManager} should bind * Android content to. * @param contextualSearchManager A {@link ContextualSearchManagementDelegate} instance. * @param readerModeManager A {@link ReaderModeManagerDelegate} instance. */ public void onFinishNativeInitialization(TabModelSelector tabModelSelector, TabCreatorManager tabCreatorManager, TabContentManager tabContentManager, ViewGroup androidContentContainer, ContextualSearchManagementDelegate contextualSearchManager, ReaderModeManagerDelegate readerModeManager) { assert mLayoutManager != null; mLayoutManager.init(tabModelSelector, tabCreatorManager, tabContentManager, androidContentContainer, contextualSearchManager, readerModeManager, mCompositorView.getResourceManager().getDynamicResourceLoader()); attachToTabModelSelector(tabModelSelector); onContentChanged(); }
Example #14
Source File: ChromeActivity.java From AndroidChromium with Apache License 2.0 | 5 votes |
@Override public TabCreatorManager.TabCreator getTabCreator(boolean incognito) { if (!mTabModelsInitialized) { throw new IllegalStateException( "Attempting to access TabCreator before initialization"); } return incognito ? mIncognitoTabCreator : mRegularTabCreator; }
Example #15
Source File: CustomTabLayoutManager.java From AndroidChromium with Apache License 2.0 | 5 votes |
@Override public void init(TabModelSelector selector, TabCreatorManager creator, TabContentManager content, ViewGroup androidContentContainer, ContextualSearchManagementDelegate contextualSearchDelegate, ReaderModeManagerDelegate readerModeDelegate, DynamicResourceLoader dynamicResourceLoader) { super.init(selector, creator, content, androidContentContainer, contextualSearchDelegate, readerModeDelegate, dynamicResourceLoader); for (TabModel model : selector.getModels()) model.addObserver(mTabModelObserver); }
Example #16
Source File: ReaderModeManager.java From AndroidChromium with Apache License 2.0 | 5 votes |
/** * Open a link from the panel in a new tab. * @param url The URL to load. */ public void createNewTab(String url) { if (mChromeActivity == null) return; Tab currentTab = mTabModelSelector.getCurrentTab(); if (currentTab == null) return; TabCreatorManager.TabCreator tabCreator = mChromeActivity.getTabCreator(currentTab.isIncognito()); if (tabCreator == null) return; tabCreator.createNewTab(new LoadUrlParams(url, PageTransition.LINK), TabModel.TabLaunchType.FROM_LINK, mChromeActivity.getActivityTab()); }
Example #17
Source File: LayoutManager.java From AndroidChromium with Apache License 2.0 | 5 votes |
/** * Initializes the {@link LayoutManager}. Must be called before using this object. * @param selector A {@link TabModelSelector} instance. * @param creator A {@link TabCreatorManager} instance. * @param content A {@link TabContentManager} instance. * @param androidContentContainer A {@link ViewGroup} for Android views to be bound to. * @param contextualSearchDelegate A {@link ContextualSearchDelegate} instance. * @param readerModeDelegate A {@link ReaderModeManagerDelegate} instance. * @param dynamicResourceLoader A {@link DynamicResourceLoader} instance. */ public void init(TabModelSelector selector, TabCreatorManager creator, TabContentManager content, ViewGroup androidContentContainer, ContextualSearchManagementDelegate contextualSearchDelegate, ReaderModeManagerDelegate readerModeDelegate, DynamicResourceLoader dynamicResourceLoader) { mTabModelSelector = selector; mContentContainer = androidContentContainer; if (mNextActiveLayout != null) startShowing(mNextActiveLayout, true); updateLayoutForTabModelSelector(); }
Example #18
Source File: LayoutManagerChromePhone.java From AndroidChromium with Apache License 2.0 | 5 votes |
@Override public void init(TabModelSelector selector, TabCreatorManager creator, TabContentManager content, ViewGroup androidContentContainer, ContextualSearchManagementDelegate contextualSearchDelegate, ReaderModeManagerDelegate readerModeDelegate, DynamicResourceLoader dynamicResourceLoader) { // Initialize Layouts mSimpleAnimationLayout.setTabModelSelector(selector, content); super.init(selector, creator, content, androidContentContainer, contextualSearchDelegate, readerModeDelegate, dynamicResourceLoader); }
Example #19
Source File: StripLayoutHelperManager.java From AndroidChromium with Apache License 2.0 | 5 votes |
/** * Sets the {@link TabModelSelector} that this {@link StripLayoutHelperManager} will visually * represent, and various objects associated with it. * @param modelSelector The {@link TabModelSelector} to visually represent. * @param tabCreatorManager The {@link TabCreatorManager}, used to create new tabs. */ public void setTabModelSelector(TabModelSelector modelSelector, TabCreatorManager tabCreatorManager) { if (mTabModelSelector == modelSelector) return; mTabModelSelector = modelSelector; mNormalHelper.setTabModel(mTabModelSelector.getModel(false), tabCreatorManager.getTabCreator(false)); mIncognitoHelper.setTabModel(mTabModelSelector.getModel(true), tabCreatorManager.getTabCreator(true)); tabModelSwitched(mTabModelSelector.isIncognitoSelected()); }
Example #20
Source File: CompositorViewHolder.java From AndroidChromium with Apache License 2.0 | 5 votes |
/** * Sets the appropriate objects this class should represent. * @param tabModelSelector The {@link TabModelSelector} this View should hold and * represent. * @param tabCreatorManager The {@link TabCreatorManager} for this view. * @param tabContentManager The {@link TabContentManager} for the tabs. * @param androidContentContainer The {@link ViewGroup} the {@link LayoutManager} should bind * Android content to. * @param contextualSearchManager A {@link ContextualSearchManagementDelegate} instance. * @param readerModeManager A {@link ReaderModeManagerDelegate} instance. */ public void onFinishNativeInitialization(TabModelSelector tabModelSelector, TabCreatorManager tabCreatorManager, TabContentManager tabContentManager, ViewGroup androidContentContainer, ContextualSearchManagementDelegate contextualSearchManager, ReaderModeManagerDelegate readerModeManager) { assert mLayoutManager != null; mLayoutManager.init(tabModelSelector, tabCreatorManager, tabContentManager, androidContentContainer, contextualSearchManager, readerModeManager, mCompositorView.getResourceManager().getDynamicResourceLoader()); mTabModelSelector = tabModelSelector; tabModelSelector.addObserver(new EmptyTabModelSelectorObserver() { @Override public void onChange() { onContentChanged(); } @Override public void onNewTabCreated(Tab tab) { initializeTab(tab); } }); mLayerTitleCache.setTabModelSelector(mTabModelSelector); onContentChanged(); }
Example #21
Source File: CustomTabLayoutManager.java From delion with Apache License 2.0 | 5 votes |
@Override public void init(TabModelSelector selector, TabCreatorManager creator, TabContentManager content, ViewGroup androidContentContainer, ContextualSearchManagementDelegate contextualSearchDelegate, ReaderModeManagerDelegate readerModeDelegate, DynamicResourceLoader dynamicResourceLoader) { super.init(selector, creator, content, androidContentContainer, contextualSearchDelegate, readerModeDelegate, dynamicResourceLoader); for (TabModel model : selector.getModels()) model.addObserver(mTabModelObserver); }
Example #22
Source File: ReaderModeManager.java From delion with Apache License 2.0 | 5 votes |
/** * Open a link from the panel in a new tab. * @param url The URL to load. */ public void createNewTab(String url) { if (mChromeActivity == null) return; Tab currentTab = mTabModelSelector.getCurrentTab(); if (currentTab == null) return; TabCreatorManager.TabCreator tabCreator = mChromeActivity.getTabCreator(currentTab.isIncognito()); if (tabCreator == null) return; tabCreator.createNewTab(new LoadUrlParams(url, PageTransition.LINK), TabModel.TabLaunchType.FROM_LINK, mChromeActivity.getActivityTab()); }
Example #23
Source File: LayoutManager.java From delion with Apache License 2.0 | 5 votes |
/** * Initializes the {@link LayoutManager}. Must be called before using this object. * @param selector A {@link TabModelSelector} instance. * @param creator A {@link TabCreatorManager} instance. * @param content A {@link TabContentManager} instance. * @param androidContentContainer A {@link ViewGroup} for Android views to be bound to. * @param contextualSearchDelegate A {@link ContextualSearchDelegate} instance. * @param readerModeDelegate A {@link ReaderModeManagerDelegate} instance. * @param dynamicResourceLoader A {@link DynamicResourceLoader} instance. */ public void init(TabModelSelector selector, TabCreatorManager creator, TabContentManager content, ViewGroup androidContentContainer, ContextualSearchManagementDelegate contextualSearchDelegate, ReaderModeManagerDelegate readerModeDelegate, DynamicResourceLoader dynamicResourceLoader) { mTabModelSelector = selector; mContentContainer = androidContentContainer; if (mNextActiveLayout != null) startShowing(mNextActiveLayout, true); updateLayoutForTabModelSelector(); }
Example #24
Source File: LayoutManagerChromePhone.java From delion with Apache License 2.0 | 5 votes |
@Override public void init(TabModelSelector selector, TabCreatorManager creator, TabContentManager content, ViewGroup androidContentContainer, ContextualSearchManagementDelegate contextualSearchDelegate, ReaderModeManagerDelegate readerModeDelegate, DynamicResourceLoader dynamicResourceLoader) { // Initialize Layouts mSimpleAnimationLayout.setTabModelSelector(selector, content); super.init(selector, creator, content, androidContentContainer, contextualSearchDelegate, readerModeDelegate, dynamicResourceLoader); }
Example #25
Source File: ChromeActivity.java From delion with Apache License 2.0 | 4 votes |
/** * Sets the {@link ChromeTabCreator}s owned by this {@link ChromeActivity}. * @param regularTabCreator A {@link ChromeTabCreator} instance. */ public void setTabCreators(TabCreatorManager.TabCreator regularTabCreator, TabCreatorManager.TabCreator incognitoTabCreator) { mRegularTabCreator = regularTabCreator; mIncognitoTabCreator = incognitoTabCreator; }
Example #26
Source File: ChromeActivity.java From delion with Apache License 2.0 | 4 votes |
@Override public TabCreatorManager.TabCreator getTabCreator(boolean incognito) { return incognito ? mIncognitoTabCreator : mRegularTabCreator; }
Example #27
Source File: ChromeActivity.java From AndroidChromium with Apache License 2.0 | 2 votes |
/** * Convenience method that returns a tab creator for the currently selected {@link TabModel}. * @return A tab creator for the currently selected {@link TabModel}. */ public TabCreatorManager.TabCreator getCurrentTabCreator() { return getTabCreator(getTabModelSelector().isIncognitoSelected()); }
Example #28
Source File: ChromeActivity.java From delion with Apache License 2.0 | 2 votes |
/** * Convenience method that returns a tab creator for the currently selected {@link TabModel}. * @return A tab creator for the currently selected {@link TabModel}. */ public TabCreatorManager.TabCreator getCurrentTabCreator() { return getTabCreator(getTabModelSelector().isIncognitoSelected()); }
Example #29
Source File: ChromeActivity.java From 365browser with Apache License 2.0 | 2 votes |
/** * Convenience method that returns a tab creator for the currently selected {@link TabModel}. * @return A tab creator for the currently selected {@link TabModel}. */ public TabCreatorManager.TabCreator getCurrentTabCreator() { return getTabCreator(getTabModelSelector().isIncognitoSelected()); }