本文整理匯總了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