当前位置: 首页>>代码示例>>Java>>正文


Java ChromeTabbedActivity2类代码示例

本文整理汇总了Java中org.chromium.chrome.browser.ChromeTabbedActivity2的典型用法代码示例。如果您正苦于以下问题:Java ChromeTabbedActivity2类的具体用法?Java ChromeTabbedActivity2怎么用?Java ChromeTabbedActivity2使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ChromeTabbedActivity2类属于org.chromium.chrome.browser包,在下文中一共展示了ChromeTabbedActivity2类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sendIntent

import org.chromium.chrome.browser.ChromeTabbedActivity2; //导入依赖的package包/类
/**
 * Sends the intent associated with the quick action if one is available.
 */
public void sendIntent() {
    if (mIntent == null) return;
    mIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

    // Set the Browser application ID to us in case the user chooses Chrome
    // as the app from the intent picker.
    Context context = getContext();
    mIntent.putExtra(Browser.EXTRA_APPLICATION_ID, context.getPackageName());
    mIntent.putExtra(Browser.EXTRA_CREATE_NEW_TAB, true);
    if (context instanceof ChromeTabbedActivity2) {
        // Set the window ID so the new tab opens in the correct window.
        mIntent.putExtra(IntentHandler.EXTRA_WINDOW_ID, 2);
    }

    IntentUtils.safeStartActivity(mContext, mIntent);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:20,代码来源:ContextualSearchQuickActionControl.java

示例2: getOpenInOtherWindowActivity

import org.chromium.chrome.browser.ChromeTabbedActivity2; //导入依赖的package包/类
/**
 * Returns the activity to use when handling "open in other window" or "move to other window".
 * Returns null if the current activity doesn't support opening/moving tabs to another activity.
 */
public Class<? extends Activity> getOpenInOtherWindowActivity(Activity current) {

    if (current instanceof ChromeTabbedActivity2) {
        // If a second ChromeTabbedActivity is created, MultiWindowUtils needs to listen for
        // activity state changes to facilitate determining which ChromeTabbedActivity should
        // be used for intents.
        ApplicationStatus.registerStateListenerForAllActivities(sInstance.get());
        return ChromeTabbedActivity.class;
    } else if (current instanceof ChromeTabbedActivity) {
        mTabbedActivity2TaskRunning = true;
        ApplicationStatus.registerStateListenerForAllActivities(sInstance.get());
        return ChromeTabbedActivity2.class;
    } else {
        return null;
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:21,代码来源:MultiWindowUtils.java

示例3: sendIntent

import org.chromium.chrome.browser.ChromeTabbedActivity2; //导入依赖的package包/类
/**
 * Sends the intent associated with the quick action if one is available.
 * @param tab The current tab, used to load a URL if the quick action should open inside
 *            Chrome.
 */
public void sendIntent(Tab tab) {
    if (mOpenQuickActionInChrome) {
        tab.loadUrl(new LoadUrlParams(mQuickActionUri));
        return;
    }

    if (mIntent == null) return;

    // Set the Browser application ID to us in case the user chooses Chrome
    // as the app from the intent picker.
    Context context = getContext();
    mIntent.putExtra(Browser.EXTRA_APPLICATION_ID, context.getPackageName());

    mIntent.putExtra(Browser.EXTRA_CREATE_NEW_TAB, true);
    mIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

    if (context instanceof ChromeTabbedActivity2) {
        // Set the window ID so the new tab opens in the correct window.
        mIntent.putExtra(IntentHandler.EXTRA_WINDOW_ID, 2);
    }

    IntentUtils.safeStartActivity(mContext, mIntent);
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:29,代码来源:ContextualSearchQuickActionControl.java

示例4: maybeSetWindowId

import org.chromium.chrome.browser.ChromeTabbedActivity2; //导入依赖的package包/类
@Override
public void maybeSetWindowId(Intent intent) {
    Context context = getAvailableContext();
    if (!(context instanceof ChromeTabbedActivity2)) return;
    intent.putExtra(IntentHandler.EXTRA_WINDOW_ID, 2);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:7,代码来源:ExternalNavigationDelegateImpl.java


注:本文中的org.chromium.chrome.browser.ChromeTabbedActivity2类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。