本文整理汇总了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;
}
}
示例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);
}
示例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