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

Unified Diff: apps/app_window.cc

Issue 296593003: Make various string_util functions take StringPieces instead of char[]. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resync Created 6 years, 7 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 | base/strings/string_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/app_window.cc
diff --git a/apps/app_window.cc b/apps/app_window.cc
index 6412b1041ba6fabfa67aacdc51131a653731a2e6..2c421db6c0f5b42422a6652ac47768d5022b6476 100644
--- a/apps/app_window.cc
+++ b/apps/app_window.cc
@@ -538,22 +538,21 @@ gfx::Rect AppWindow::GetClientBounds() const {
}
base::string16 AppWindow::GetTitle() const {
- base::string16 title;
const extensions::Extension* extension = GetExtension();
if (!extension)
- return title;
+ return base::string16();
// WebContents::GetTitle() will return the page's URL if there's no <title>
// 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()) {
title = base::UTF8ToUTF16(extension->name());
} else {
title = web_contents()->GetTitle();
}
- const base::char16 kBadChars[] = {'\n', 0};
- base::RemoveChars(title, kBadChars, &title);
+ base::RemoveChars(title, base::ASCIIToUTF16("\n"), &title);
return title;
}
« no previous file with comments | « no previous file | base/strings/string_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698