Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1192)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionActivity.java

Issue 2997163002: Revert of [Android] Open a tab in the background from Browser Actions if ChromeTabbedActivity... (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionsContextMenuHelper.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionActivity.java
index 1e5919f43b6d04e4113de4f7e807179adc1afa5e..c611ca60c6b322e82a6d977fafb3bf8fd432459c 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionActivity.java
@@ -11,12 +11,10 @@
import android.os.Bundle;
import android.support.customtabs.browseractions.BrowserActionItem;
import android.support.customtabs.browseractions.BrowserActionsIntent;
-import android.text.TextUtils;
import android.view.Menu;
import android.view.View;
import org.chromium.base.Log;
-import org.chromium.base.VisibleForTesting;
import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.chrome.browser.IntentHandler;
import org.chromium.chrome.browser.UrlConstants;
@@ -76,8 +74,7 @@
} else if (mCreatorPackageName == null) {
Log.e(TAG, "Missing creator's pacakge name");
return false;
- } else if (!TextUtils.equals(mCreatorPackageName, getPackageName())
- && (intent.getFlags() & Intent.FLAG_ACTIVITY_NEW_TASK) != 0) {
+ } else if ((intent.getFlags() & Intent.FLAG_ACTIVITY_NEW_TASK) != 0) {
Log.e(TAG, "Intent should not be started with FLAG_ACTIVITY_NEW_TASK");
return false;
} else if ((intent.getFlags() & Intent.FLAG_ACTIVITY_NEW_DOCUMENT) != 0) {
@@ -94,24 +91,10 @@
@Override
public void openContextMenu(View view) {
ContextMenuParams params = createContextMenuParams();
- Runnable listener = new Runnable() {
- @Override
- public void run() {
- startDelayedNativeInitialization();
- }
- };
- mHelper = new BrowserActionsContextMenuHelper(this, params, mActions, mCreatorPackageName,
- mOnBrowserActionSelectedCallback, listener);
+ mHelper = new BrowserActionsContextMenuHelper(
+ this, params, mActions, mCreatorPackageName, mOnBrowserActionSelectedCallback);
mHelper.displayBrowserActionsMenu(view);
return;
- }
-
- /**
- * @return The {@link BrowserActionsContextMenuHelper} for testing.
- */
- @VisibleForTesting
- BrowserActionsContextMenuHelper getHelperForTesting() {
- return mHelper;
}
/**
@@ -142,6 +125,13 @@
return true;
}
+ /**
+ * Callback when Browser Actions menu dialog is shown.
+ */
+ public void onMenuShown() {
+ startDelayedNativeInitialization();
+ }
+
@Override
public void onContextMenuClosed(Menu menu) {
super.onContextMenuClosed(menu);
@@ -149,10 +139,4 @@
mHelper.onContextMenuClosed();
}
}
-
- @Override
- public void finishNativeInitialization() {
- super.finishNativeInitialization();
- mHelper.onNativeInitialized();
- }
}
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionsContextMenuHelper.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698