| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/autofill/core/browser/autofill_external_delegate.h" | 5 #include "components/autofill/core/browser/autofill_external_delegate.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 | 209 |
| 210 void AutofillExternalDelegate::DidAcceptSuggestion(const base::string16& value, | 210 void AutofillExternalDelegate::DidAcceptSuggestion(const base::string16& value, |
| 211 int identifier, | 211 int identifier, |
| 212 int position) { | 212 int position) { |
| 213 if (identifier == POPUP_ITEM_ID_AUTOFILL_OPTIONS) { | 213 if (identifier == POPUP_ITEM_ID_AUTOFILL_OPTIONS) { |
| 214 // User selected 'Autofill Options'. | 214 // User selected 'Autofill Options'. |
| 215 manager_->ShowAutofillSettings(); | 215 manager_->ShowAutofillSettings(); |
| 216 } else if (identifier == POPUP_ITEM_ID_CLEAR_FORM) { | 216 } else if (identifier == POPUP_ITEM_ID_CLEAR_FORM) { |
| 217 // User selected 'Clear form'. | 217 // User selected 'Clear form'. |
| 218 driver_->RendererShouldClearFilledForm(); | 218 driver_->RendererShouldClearFilledForm(); |
| 219 } else if (identifier == POPUP_ITEM_ID_PASSWORD_ENTRY) { | 219 } else if (identifier == POPUP_ITEM_ID_PASSWORD_ENTRY || |
| 220 identifier == POPUP_ITEM_ID_USERNAME_ENTRY) { |
| 220 NOTREACHED(); // Should be handled elsewhere. | 221 NOTREACHED(); // Should be handled elsewhere. |
| 221 } else if (identifier == POPUP_ITEM_ID_DATALIST_ENTRY) { | 222 } else if (identifier == POPUP_ITEM_ID_DATALIST_ENTRY) { |
| 222 driver_->RendererShouldAcceptDataListSuggestion(value); | 223 driver_->RendererShouldAcceptDataListSuggestion(value); |
| 223 } else if (identifier == POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY) { | 224 } else if (identifier == POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY) { |
| 224 // User selected an Autocomplete, so we fill directly. | 225 // User selected an Autocomplete, so we fill directly. |
| 225 driver_->RendererShouldFillFieldWithValue(value); | 226 driver_->RendererShouldFillFieldWithValue(value); |
| 226 AutofillMetrics::LogAutocompleteSuggestionAcceptedIndex(position); | 227 AutofillMetrics::LogAutocompleteSuggestionAcceptedIndex(position); |
| 227 } else if (identifier == POPUP_ITEM_ID_SCAN_CREDIT_CARD) { | 228 } else if (identifier == POPUP_ITEM_ID_SCAN_CREDIT_CARD) { |
| 228 manager_->client()->ScanCreditCard(base::Bind( | 229 manager_->client()->ScanCreditCard(base::Bind( |
| 229 &AutofillExternalDelegate::OnCreditCardScanned, GetWeakPtr())); | 230 &AutofillExternalDelegate::OnCreditCardScanned, GetWeakPtr())); |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 const { | 391 const { |
| 391 if (IsKeyboardAccessoryEnabled()) { | 392 if (IsKeyboardAccessoryEnabled()) { |
| 392 return l10n_util::GetStringUTF16(IDS_AUTOFILL_OPTIONS_CONTENT_DESCRIPTION); | 393 return l10n_util::GetStringUTF16(IDS_AUTOFILL_OPTIONS_CONTENT_DESCRIPTION); |
| 393 } | 394 } |
| 394 return l10n_util::GetStringUTF16(is_credit_card_popup_ ? | 395 return l10n_util::GetStringUTF16(is_credit_card_popup_ ? |
| 395 IDS_AUTOFILL_CREDIT_CARD_OPTIONS_POPUP : | 396 IDS_AUTOFILL_CREDIT_CARD_OPTIONS_POPUP : |
| 396 IDS_AUTOFILL_OPTIONS_POPUP); | 397 IDS_AUTOFILL_OPTIONS_POPUP); |
| 397 } | 398 } |
| 398 | 399 |
| 399 } // namespace autofill | 400 } // namespace autofill |
| OLD | NEW |