Chromium Code Reviews| 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..b9ac8797dade3bae34bc8c551ab4bbf01a2c40f6 100644 |
| --- a/chrome/browser/autofill/autofill_external_delegate.cc |
| +++ b/chrome/browser/autofill/autofill_external_delegate.cc |
| @@ -13,19 +13,10 @@ |
| #include "grit/chromium_strings.h" |
| #include "grit/generated_resources.h" |
| #include "ui/base/l10n/l10n_util.h" |
| +#include "third_party/WebKit/Source/WebKit/chromium/public/WebAutofillClient.h" |
|
Ilya Sherman
2012/04/11 19:09:58
nit: This should come before the "ui/..." include
keishi
2012/04/12 14:07:11
Done.
|
| 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 |
| - |
| AutofillExternalDelegate::~AutofillExternalDelegate() { |
| } |
| @@ -51,7 +42,7 @@ void AutofillExternalDelegate::SelectAutofillSuggestionAtIndex(int unique_id, |
| if (list_index == suggestions_options_index_ || |
| list_index == suggestions_clear_index_ || |
| - unique_id == kWarningId) |
| + unique_id == WebKit::WarningMessageMenuItemID) |
| return; |
| FillAutofillFormData(unique_id, true); |
| @@ -97,7 +88,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, WebKit::WarningMessageMenuItemID); |
| } 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 +157,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(), |
| + WebKit::PasswordEntryMenuItemID); |
| ApplyAutofillSuggestions(suggestions, empty, empty, password_ids, -1); |
| } |
| @@ -179,7 +171,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 == WebKit::WarningMessageMenuItemID) |
| return false; |
| if (suggestions_options_index_ != -1 && |