| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 if (should_show_scan_credit_card_) { | 256 if (should_show_scan_credit_card_) { |
| 257 AutofillMetrics::LogScanCreditCardPromptMetric( | 257 AutofillMetrics::LogScanCreditCardPromptMetric( |
| 258 identifier == POPUP_ITEM_ID_SCAN_CREDIT_CARD | 258 identifier == POPUP_ITEM_ID_SCAN_CREDIT_CARD |
| 259 ? AutofillMetrics::SCAN_CARD_ITEM_SELECTED | 259 ? AutofillMetrics::SCAN_CARD_ITEM_SELECTED |
| 260 : AutofillMetrics::SCAN_CARD_OTHER_ITEM_SELECTED); | 260 : AutofillMetrics::SCAN_CARD_OTHER_ITEM_SELECTED); |
| 261 } | 261 } |
| 262 | 262 |
| 263 manager_->client()->HideAutofillPopup(); | 263 manager_->client()->HideAutofillPopup(); |
| 264 } | 264 } |
| 265 | 265 |
| 266 void AutofillExternalDelegate::RemoveSuggestion(const base::string16& value, | 266 bool AutofillExternalDelegate::RemoveSuggestion(const base::string16& value, |
| 267 int identifier) { | 267 int identifier) { |
| 268 if (identifier > 0) | 268 if (identifier > 0) |
| 269 manager_->RemoveAutofillProfileOrCreditCard(identifier); | 269 return manager_->RemoveAutofillProfileOrCreditCard(identifier); |
| 270 else | 270 |
| 271 if (identifier == POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY) { |
| 271 manager_->RemoveAutocompleteEntry(query_field_.name, value); | 272 manager_->RemoveAutocompleteEntry(query_field_.name, value); |
| 273 return true; |
| 274 } |
| 275 |
| 276 return false; |
| 272 } | 277 } |
| 273 | 278 |
| 274 void AutofillExternalDelegate::DidEndTextFieldEditing() { | 279 void AutofillExternalDelegate::DidEndTextFieldEditing() { |
| 275 manager_->client()->HideAutofillPopup(); | 280 manager_->client()->HideAutofillPopup(); |
| 276 | 281 |
| 277 has_shown_popup_for_current_edit_ = false; | 282 has_shown_popup_for_current_edit_ = false; |
| 278 } | 283 } |
| 279 | 284 |
| 280 void AutofillExternalDelegate::ClearPreviewedForm() { | 285 void AutofillExternalDelegate::ClearPreviewedForm() { |
| 281 driver_->RendererShouldClearPreviewedForm(); | 286 driver_->RendererShouldClearPreviewedForm(); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 } | 376 } |
| 372 } | 377 } |
| 373 | 378 |
| 374 #if defined(OS_MACOSX) && !defined(OS_IOS) | 379 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 375 void AutofillExternalDelegate::PingRenderer() { | 380 void AutofillExternalDelegate::PingRenderer() { |
| 376 driver_->PingRenderer(); | 381 driver_->PingRenderer(); |
| 377 } | 382 } |
| 378 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 383 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
| 379 | 384 |
| 380 } // namespace autofill | 385 } // namespace autofill |
| OLD | NEW |