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

Unified Diff: chrome/browser/ui/webui/ntp/app_launcher_handler.cc

Issue 1887303002: Collapse whitespace in app names derived from links. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment spaces Created 4 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/ntp/app_launcher_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
index 22f72747000333d05beb94075716f7d634dc2837..4521713224cc7852db281c9936f57b05bb21cac7 100644
--- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
+++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
@@ -16,6 +16,7 @@
#include "base/i18n/rtl.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
+#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
@@ -720,7 +721,8 @@ void AppLauncherHandler::HandleGenerateAppForLink(const base::ListValue* args) {
}
std::unique_ptr<AppInstallInfo> install_info(new AppInstallInfo());
- install_info->title = title;
+ install_info->title = base::CollapseWhitespace(
+ title, /* trim_sequences_with_line_breaks */ false);
install_info->app_url = launch_url;
install_info->page_ordinal = page_ordinal;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698