diff options
author | dfalcantara@chromium.org <dfalcantara@chromium.org> | 2015-01-23 10:18:35 -0800 |
---|---|---|
committer | dfalcantara@chromium.org <dfalcantara@chromium.org> | 2015-01-23 18:22:47 +0000 |
commit | 08d03369f1fa815f5e9d3f956926b8189a940c02 (patch) | |
tree | cf978848653c3efbe1079e7420f03f3f0a846f45 | |
parent | acddfae4caf7f098c31f6114843be71644db9b84 (diff) | |
download | chromium_src-08d03369f1fa815f5e9d3f956926b8189a940c02.zip chromium_src-08d03369f1fa815f5e9d3f956926b8189a940c02.tar.gz chromium_src-08d03369f1fa815f5e9d3f956926b8189a940c02.tar.bz2 |
Don't overwrite Tab title if unnecessary
Messed up the logic slightly when refactoring the code. If a
native page exists, the title should always be the one belonging to the native page.
Original logic located here, in Tab.getTitle():
https://codereview.chromium.org/834723002
BUG=450997
TBR=newt
Review URL: https://codereview.chromium.org/871583004
Cr-Commit-Position: refs/heads/master@{#312698}
Review URL: https://codereview.chromium.org/867343002
Cr-Commit-Position: refs/branch-heads/2272@{#97}
Cr-Branched-From: 827a380cfdb31aa54c8d56e63ce2c3fd8c3ba4d4-refs/heads/master@{#310958}
-rw-r--r-- | chrome/android/java/src/org/chromium/chrome/browser/Tab.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/Tab.java b/chrome/android/java/src/org/chromium/chrome/browser/Tab.java index 21565a6..6236046 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/Tab.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/Tab.java @@ -1522,8 +1522,11 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener, // When restoring the tabs, the title will no longer be populated, so request it from the // ContentViewCore or NativePage (if present). String title = ""; - if (mNativePage != null) title = mNativePage.getTitle(); - if (getWebContents() != null) title = getWebContents().getTitle(); + if (mNativePage != null) { + title = mNativePage.getTitle(); + } else if (getWebContents() != null) { + title = getWebContents().getTitle(); + } updateTitle(title); } |