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

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

Issue 2601183002: Remove code that implies external apps can open incognito tabs. (Closed)
Patch Set: Add package check Created 4 years 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/IntentHandler.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/ChromeTabbedActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
index e18d378c7174abf09a22c6cd5e6a9148d610232f..4701a6b175ccf433e3dcb8a43514f6115a880012 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
@@ -839,34 +839,28 @@ public class ChromeTabbedActivity extends ChromeActivity implements OverviewMode
openNewTab(url, referer, headers, externalAppId, intent, true);
break;
case OPEN_NEW_INCOGNITO_TAB:
+ if (!TextUtils.equals(externalAppId, getPackageName())) {
+ assert false : "Only Chrome is allowed to open incognito tabs";
+ Log.e(TAG, "Only Chrome is allowed to open incognito tabs");
+ return;
+ }
+
if (url == null || url.equals(UrlConstants.NTP_URL)) {
- TabLaunchType launchType;
if (fromLauncherShortcut) {
getTabCreator(true).launchUrl(
UrlConstants.NTP_URL, TabLaunchType.FROM_EXTERNAL_APP);
recordLauncherShortcutAction(true);
reportNewTabShortcutUsed(true);
- } else if (TextUtils.equals(externalAppId, getPackageName())) {
+ } else {
// Used by the Account management screen to open a new incognito tab.
// Account management screen collects its metrics separately.
getTabCreator(true).launchUrl(
UrlConstants.NTP_URL, TabLaunchType.FROM_CHROME_UI,
intent, mIntentHandlingTimeMs);
- } else {
- getTabCreator(true).launchUrl(
- UrlConstants.NTP_URL, TabLaunchType.FROM_EXTERNAL_APP,
- intent, mIntentHandlingTimeMs);
- RecordUserAction.record("MobileReceivedExternalIntent");
}
} else {
- if (TextUtils.equals(externalAppId, getPackageName())) {
- getTabCreator(true).launchUrl(
- url, TabLaunchType.FROM_LINK, intent, mIntentHandlingTimeMs);
- } else {
- getTabCreator(true).launchUrlFromExternalApp(url, referer, headers,
- externalAppId, true, intent, mIntentHandlingTimeMs);
- RecordUserAction.record("MobileReceivedExternalIntent");
- }
+ getTabCreator(true).launchUrl(
+ url, TabLaunchType.FROM_LINK, intent, mIntentHandlingTimeMs);
}
break;
default:
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698