summaryrefslogtreecommitdiffstats
path: root/extensions/browser/app_window
diff options
context:
space:
mode:
authortfarina <tfarina@chromium.org>2015-07-07 15:15:53 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-07 22:16:44 +0000
commit52b068ff072d4476f64d7d93e3768828879893a3 (patch)
tree5438679c245ee175422c04ab4c7ec06687c6ad21 /extensions/browser/app_window
parent725a6cae963a44de80afec2e3cd9d597fecf7b7d (diff)
downloadchromium_src-52b068ff072d4476f64d7d93e3768828879893a3.zip
chromium_src-52b068ff072d4476f64d7d93e3768828879893a3.tar.gz
chromium_src-52b068ff072d4476f64d7d93e3768828879893a3.tar.bz2
extensions: Replace usage of GetActiveEntry by GetLastCommittedEntry.
According to the bug crbug.com/273710 it can lead to security issues. BUG=273710 R=nasko@chromium.org Review URL: https://codereview.chromium.org/1220673003 Cr-Commit-Position: refs/heads/master@{#337693}
Diffstat (limited to 'extensions/browser/app_window')
-rw-r--r--extensions/browser/app_window/app_window.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/extensions/browser/app_window/app_window.cc b/extensions/browser/app_window/app_window.cc
index 5a40efd..fb99b1b 100644
--- a/extensions/browser/app_window/app_window.cc
+++ b/extensions/browser/app_window/app_window.cc
@@ -524,8 +524,9 @@ base::string16 AppWindow::GetTitle() const {
// specified. However, we'd prefer to show the name of the extension in that
// case, so we directly inspect the NavigationEntry's title.
base::string16 title;
- if (!web_contents() || !web_contents()->GetController().GetActiveEntry() ||
- web_contents()->GetController().GetActiveEntry()->GetTitle().empty()) {
+ content::NavigationEntry* entry = web_contents() ?
+ web_contents()->GetController().GetLastCommittedEntry() : nullptr;
+ if (!entry || entry->GetTitle().empty()) {
title = base::UTF8ToUTF16(extension->name());
} else {
title = web_contents()->GetTitle();