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

Unified Diff: chrome/browser/autofill/autofill_popup_view.cc

Issue 10408070: Upgrade Seperator in New Autofill UI (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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
Index: chrome/browser/autofill/autofill_popup_view.cc
diff --git a/chrome/browser/autofill/autofill_popup_view.cc b/chrome/browser/autofill/autofill_popup_view.cc
index bead013e617235da4a0c86f122090ca2171212db..ade3d7bdcc3afecc711fb128dd954b140db2849b 100644
--- a/chrome/browser/autofill/autofill_popup_view.cc
+++ b/chrome/browser/autofill/autofill_popup_view.cc
@@ -121,6 +121,9 @@ bool AutofillPopupView::AcceptSelectedLine() {
DCHECK_GE(selected_line_, 0);
DCHECK_LT(selected_line_, static_cast<int>(autofill_values_.size()));
+ if (!CanAccept(autofill_unique_ids_[selected_line_]))
+ return false;
+
return external_delegate()->DidAcceptAutofillSuggestions(
autofill_values_[selected_line_],
autofill_unique_ids_[selected_line_],
@@ -162,13 +165,6 @@ bool AutofillPopupView::RemoveSelectedLine() {
return true;
}
-bool AutofillPopupView::IsSeparatorIndex(int index) {
- // TODO(csharp): Use WebAutofillClient::MenuItemIDSeparator instead.
- // http://crbug.com/125001
- return (index > 0 && autofill_unique_ids_[index - 1] >= 0 &&
- autofill_unique_ids_[index] < 0);
-}
-
int AutofillPopupView::GetIconResourceID(const string16& resource_name) {
for (size_t i = 0; i < arraysize(kDataResources); ++i) {
if (resource_name == ASCIIToUTF16(kDataResources[i].name))
@@ -178,6 +174,10 @@ int AutofillPopupView::GetIconResourceID(const string16& resource_name) {
return -1;
}
+bool AutofillPopupView::CanAccept(int id) {
+ return id != WebAutofillClient::MenuItemIDSeparator;
+}
+
bool AutofillPopupView::CanDelete(int id) {
return id > 0 ||
id == WebAutofillClient::MenuItemIDAutocompleteEntry ||
« no previous file with comments | « chrome/browser/autofill/autofill_popup_view.h ('k') | chrome/browser/ui/gtk/autofill/autofill_popup_view_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698