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

Unified Diff: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc

Issue 264053007: [rAC] Display Autofill popups vertically compact. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
index ec41f89602dcf84152fa929b076ceec5286851a1..9711a64cc5277acbf8e0d1aa5145592cea39e3b2 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
@@ -86,6 +86,7 @@
#include "third_party/libaddressinput/chromium/chrome_storage_impl.h"
#include "third_party/libaddressinput/chromium/cpp/include/libaddressinput/address_data.h"
#include "third_party/libaddressinput/chromium/cpp/include/libaddressinput/address_problem.h"
+#include "third_party/libaddressinput/chromium/cpp/include/libaddressinput/address_ui.h"
#include "ui/base/base_window.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/combobox_model.h"
@@ -2141,6 +2142,18 @@ void AutofillDialogControllerImpl::UserEditedOrActivatedInput(
popup_ids.push_back(i);
}
+ // Names need to be in vertically compact form - i.e. a single line. Join
+ // multi-line names into a single line, using a separator.
+ // The separator is locale-specific.
+ base::string16 compact_separator =
+ base::UTF8ToUTF16(::i18n::addressinput::GetCompactAddressLinesSeparator(
+ AddressLanguageCodeForSection(section)));
+ for (size_t i = 0; i < popup_values.size(); ++i) {
+ std::vector<base::string16> lines;
+ base::SplitString(popup_values[i], '\n', &lines);
+ popup_values[i] = (JoinString(lines, compact_separator));
+ }
Evan Stade 2014/05/07 00:46:16 This needs to be done in GetProfileSuggestions so
+
popup_controller_ = AutofillPopupControllerImpl::GetOrCreate(
popup_controller_,
weak_ptr_factory_.GetWeakPtr(),
« 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