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

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

Issue 10024059: DataList UI (Chromium part) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed nits and tests Created 8 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 | chrome/browser/autofill/autofill_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/autofill_external_delegate.cc
diff --git a/chrome/browser/autofill/autofill_external_delegate.cc b/chrome/browser/autofill/autofill_external_delegate.cc
index ff94bd4ec72a6d5a318b8a51c4dfc6f14ce83c70..08ce18a0f74af0e02c0a673f28de4724c40345c5 100644
--- a/chrome/browser/autofill/autofill_external_delegate.cc
+++ b/chrome/browser/autofill/autofill_external_delegate.cc
@@ -12,19 +12,11 @@
#include "content/public/browser/web_contents.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebAutofillClient.h"
#include "ui/base/l10n/l10n_util.h"
using content::RenderViewHost;
-
-namespace {
-
-// The value to give as the unique id for all warnings.
-const int kWarningId = -1;
-
-// The value to give as the unique id for all password entries.
-const int kPasswordEntryId = -2;
-
-} // namespace
+using WebKit::WebAutofillClient;
AutofillExternalDelegate::~AutofillExternalDelegate() {
}
@@ -51,7 +43,7 @@ void AutofillExternalDelegate::SelectAutofillSuggestionAtIndex(int unique_id,
if (list_index == suggestions_options_index_ ||
list_index == suggestions_clear_index_ ||
- unique_id == kWarningId)
+ unique_id == WebAutofillClient::MenuItemIDWarningMessage)
return;
FillAutofillFormData(unique_id, true);
@@ -97,7 +89,7 @@ void AutofillExternalDelegate::OnSuggestionsReturned(
v.assign(1, l10n_util::GetStringUTF16(IDS_AUTOFILL_WARNING_FORM_DISABLED));
l.assign(1, string16());
i.assign(1, string16());
- ids.assign(1, kWarningId);
+ ids.assign(1, WebAutofillClient::MenuItemIDWarningMessage);
} else if (ids[0] < 0 && ids.size() > 1) {
// If we received a warning instead of suggestions from autofill but regular
// suggestions from autocomplete, don't show the autofill warning.
@@ -166,7 +158,8 @@ void AutofillExternalDelegate::OnShowPasswordSuggestions(
SetBounds(bounds);
std::vector<string16> empty(suggestions.size());
- std::vector<int> password_ids(suggestions.size(), kPasswordEntryId);
+ std::vector<int> password_ids(suggestions.size(),
+ WebAutofillClient::MenuItemIDPasswordEntry);
ApplyAutofillSuggestions(suggestions, empty, empty, password_ids, -1);
}
@@ -179,7 +172,7 @@ bool AutofillExternalDelegate::DidAcceptAutofillSuggestions(
int unique_id,
unsigned index) {
// If the selected element is a warning we don't want to do anything.
- if (unique_id == kWarningId)
+ if (unique_id == WebAutofillClient::MenuItemIDWarningMessage)
return false;
if (suggestions_options_index_ != -1 &&
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698