Java Code Examples for org.chromium.chrome.browser.tabmodel.TabModelSelector#getModels()

The following examples show how to use org.chromium.chrome.browser.tabmodel.TabModelSelector#getModels() . 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: CustomTabLayoutManager.java    From delion with Apache License 2.0 5 votes vote down vote up
@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 2
Source File: ContextualSearchManager.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * Stops listening for notifications that should hide the Contextual Search bar.
 */
private void stopListeningForHideNotifications() {
    if (mTabModelSelectorTabObserver != null) mTabModelSelectorTabObserver.destroy();

    TabModelSelector selector = mActivity.getTabModelSelector();
    if (selector != null) {
        for (TabModel tabModel : selector.getModels()) {
            tabModel.removeObserver(mTabModelObserver);
        }
    }
}
 
Example 3
Source File: CustomTabLayoutManager.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@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 4
Source File: CustomTabTabPersistencePolicy.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
/**
 * Get all current Tab IDs used by the specified activity.
 *
 * @param activity The activity whose tab IDs are to be collected from.
 * @param tabIds Where the tab IDs should be added to.
 */
private static void getAllTabIdsForActivity(CustomTabActivity activity, Set<Integer> tabIds) {
    if (activity == null) return;
    TabModelSelector selector = activity.getTabModelSelector();
    if (selector == null) return;
    List<TabModel> models = selector.getModels();
    for (int i = 0; i < models.size(); i++) {
        TabModel model = models.get(i);
        for (int j = 0; j < model.getCount(); j++) {
            tabIds.add(model.getTabAt(j).getId());
        }
    }
}
 
Example 5
Source File: ContextualSearchManager.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
/**
 * Stops listening for notifications that should hide the Contextual Search bar.
 */
private void stopListeningForHideNotifications() {
    if (mTabModelSelectorTabObserver != null) mTabModelSelectorTabObserver.destroy();

    TabModelSelector selector = mActivity.getTabModelSelector();
    if (selector != null) {
        for (TabModel tabModel : selector.getModels()) {
            tabModel.removeObserver(mTabModelObserver);
        }
    }
}
 
Example 6
Source File: CustomTabLayoutManager.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@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 7
Source File: CustomTabTabPersistencePolicy.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * Get all current Tab IDs used by the specified activity.
 *
 * @param activity The activity whose tab IDs are to be collected from.
 * @param tabIds Where the tab IDs should be added to.
 */
private static void getAllTabIdsForActivity(CustomTabActivity activity, Set<Integer> tabIds) {
    if (activity == null) return;
    TabModelSelector selector = activity.getTabModelSelector();
    if (selector == null) return;
    List<TabModel> models = selector.getModels();
    for (int i = 0; i < models.size(); i++) {
        TabModel model = models.get(i);
        for (int j = 0; j < model.getCount(); j++) {
            tabIds.add(model.getTabAt(j).getId());
        }
    }
}
 
Example 8
Source File: ContextualSearchManager.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/** Stops listening for notifications that should hide the Contextual Search bar. */
private void stopListeningForHideNotifications() {
    if (mTabModelSelectorTabObserver != null) mTabModelSelectorTabObserver.destroy();

    TabModelSelector selector = mActivity.getTabModelSelector();
    if (selector != null) {
        for (TabModel tabModel : selector.getModels()) {
            tabModel.removeObserver(mTabModelObserver);
        }
    }
}