diff options
author | Ian Wen <ianwen@google.com> | 2016-02-01 13:04:38 -0800 |
---|---|---|
committer | Ian Wen <ianwen@google.com> | 2016-02-01 21:06:11 +0000 |
commit | ce590070fe9284302a3db2d30b3a0b9d509a58ef (patch) | |
tree | 8bc834624df4221564497863e4640aee1d4221e2 | |
parent | 0e70f51e924610e906e101bc07c98b2940303bff (diff) | |
download | chromium_src-ce590070fe9284302a3db2d30b3a0b9d509a58ef.zip chromium_src-ce590070fe9284302a3db2d30b3a0b9d509a58ef.tar.gz chromium_src-ce590070fe9284302a3db2d30b3a0b9d509a58ef.tar.bz2 |
Prevent a crash where WebcontentsDelegate foregrounds a custom tab
Tab.createBringTabToFrontIntent() is null for a custom tab, and
TabWebContentsDelegateAndroid should handle it elegantly.
BUG=575293
Review URL: https://codereview.chromium.org/1651473003
Cr-Commit-Position: refs/heads/master@{#372493}
TBR=dfalcantara@chromium.org
Review URL: https://codereview.chromium.org/1654843004 .
Cr-Commit-Position: refs/branch-heads/2623@{#221}
Cr-Branched-From: 92d77538a86529ca35f9220bd3cd512cbea1f086-refs/heads/master@{#369907}
-rw-r--r-- | chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsDelegateAndroid.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsDelegateAndroid.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsDelegateAndroid.java index 23946c5..90a8075 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsDelegateAndroid.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsDelegateAndroid.java @@ -385,9 +385,10 @@ public class TabWebContentsDelegateAndroid extends WebContentsDelegateAndroid { // because it will change the tab when the intent is handled, which happens after // Chrome gets back to the foreground. Intent newIntent = Tab.createBringTabToFrontIntent(mTab.getId()); - newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - - mTab.getApplicationContext().startActivity(newIntent); + if (newIntent != null) { + newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + mTab.getApplicationContext().startActivity(newIntent); + } } @Override |