| 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 NOTREACHED(); // Should be handled elsewhere. | 220 NOTREACHED(); // Should be handled elsewhere. |
| 221 } else if (identifier == POPUP_ITEM_ID_DATALIST_ENTRY) { | 221 } else if (identifier == POPUP_ITEM_ID_DATALIST_ENTRY) { |
| 222 driver_->RendererShouldAcceptDataListSuggestion(value); | 222 driver_->RendererShouldAcceptDataListSuggestion(value); |
| 223 } else if (identifier == POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY) { | 223 } else if (identifier == POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY) { |
| 224 // User selected an Autocomplete, so we fill directly. | 224 // User selected an Autocomplete, so we fill directly. |
| 225 driver_->RendererShouldFillFieldWithValue(value); | 225 driver_->RendererShouldFillFieldWithValue(value); |
| 226 AutofillMetrics::LogAutocompleteSuggestionAcceptedIndex(position); | 226 AutofillMetrics::LogAutocompleteSuggestionAcceptedIndex(position); |
| 227 } else if (identifier == POPUP_ITEM_ID_SCAN_CREDIT_CARD) { | 227 } else if (identifier == POPUP_ITEM_ID_SCAN_CREDIT_CARD) { |
| 228 manager_->client()->ScanCreditCard(base::Bind( | 228 manager_->client()->ScanCreditCard(base::Bind( |
| 229 &AutofillExternalDelegate::OnCreditCardScanned, GetWeakPtr())); | 229 &AutofillExternalDelegate::OnCreditCardScanned, GetWeakPtr())); |
| 230 } else if (identifier == POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO) { | 230 } else if (identifier == POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO || |
| 231 manager_->client()->StartSigninFlow(); | 231 identifier == POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE) { |
| 232 } else if (identifier == POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE) { | 232 manager_->client()->ExecuteCommand(identifier); |
| 233 AutofillMetrics::LogShowedHttpNotSecureExplanation(); | |
| 234 manager_->client()->ShowHttpNotSecureExplanation(); | |
| 235 } else { | 233 } else { |
| 236 if (identifier > 0) // Denotes an Autofill suggestion. | 234 if (identifier > 0) // Denotes an Autofill suggestion. |
| 237 AutofillMetrics::LogAutofillSuggestionAcceptedIndex(position); | 235 AutofillMetrics::LogAutofillSuggestionAcceptedIndex(position); |
| 238 | 236 |
| 239 FillAutofillFormData(identifier, false); | 237 FillAutofillFormData(identifier, false); |
| 240 } | 238 } |
| 241 | 239 |
| 242 if (should_show_scan_credit_card_) { | 240 if (should_show_scan_credit_card_) { |
| 243 AutofillMetrics::LogScanCreditCardPromptMetric( | 241 AutofillMetrics::LogScanCreditCardPromptMetric( |
| 244 identifier == POPUP_ITEM_ID_SCAN_CREDIT_CARD | 242 identifier == POPUP_ITEM_ID_SCAN_CREDIT_CARD |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 const { | 404 const { |
| 407 if (IsKeyboardAccessoryEnabled()) { | 405 if (IsKeyboardAccessoryEnabled()) { |
| 408 return l10n_util::GetStringUTF16(IDS_AUTOFILL_OPTIONS_CONTENT_DESCRIPTION); | 406 return l10n_util::GetStringUTF16(IDS_AUTOFILL_OPTIONS_CONTENT_DESCRIPTION); |
| 409 } | 407 } |
| 410 return l10n_util::GetStringUTF16(is_credit_card_popup_ ? | 408 return l10n_util::GetStringUTF16(is_credit_card_popup_ ? |
| 411 IDS_AUTOFILL_CREDIT_CARD_OPTIONS_POPUP : | 409 IDS_AUTOFILL_CREDIT_CARD_OPTIONS_POPUP : |
| 412 IDS_AUTOFILL_OPTIONS_POPUP); | 410 IDS_AUTOFILL_OPTIONS_POPUP); |
| 413 } | 411 } |
| 414 | 412 |
| 415 } // namespace autofill | 413 } // namespace autofill |
| OLD | NEW |