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

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: 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..5a88fd60a96b4a686fefba7af4933ebf4c0dc37a 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);
Evan Stade 2016/04/15 20:47:41 nit: is the spacing correct inside the /**/?
dcheng 2016/04/15 21:03:13 I couldn't remember what our usual convention is.
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