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

Unified Diff: chrome/browser/ui/webui/options/create_profile_handler.cc

Issue 532023003: [Profiles] Trim profile names in chrome://settings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 6 years, 3 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
Index: chrome/browser/ui/webui/options/create_profile_handler.cc
diff --git a/chrome/browser/ui/webui/options/create_profile_handler.cc b/chrome/browser/ui/webui/options/create_profile_handler.cc
index d7c88a60af9c09853ddcc2ddb72fc909fe8be568..8d722e7349a54212a053127cbdb408f95caad431 100644
--- a/chrome/browser/ui/webui/options/create_profile_handler.cc
+++ b/chrome/browser/ui/webui/options/create_profile_handler.cc
@@ -8,6 +8,7 @@
#include "base/files/file_path.h"
#include "base/metrics/histogram.h"
#include "base/prefs/pref_service.h"
+#include "base/strings/string_util.h"
#include "base/value_conversions.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
@@ -80,6 +81,7 @@ void CreateProfileHandler::CreateProfile(const base::ListValue* args) {
bool create_shortcut = false;
bool supervised_user = false;
if (args->GetString(0, &name) && args->GetString(1, &icon)) {
+ base::TrimWhitespace(name, base::TRIM_ALL, &name);
Dan Beam 2014/09/11 17:54:08 CHECK(!name.empty());
noms (inactive) 2014/09/15 21:12:26 Done in https://codereview.chromium.org/562233002.
if (args->GetBoolean(2, &create_shortcut)) {
bool success = args->GetBoolean(3, &supervised_user);
DCHECK(success);

Powered by Google App Engine
This is Rietveld 408576698