| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 // Add a separator to go between the values and menu items. | 105 // Add a separator to go between the values and menu items. |
| 106 values.push_back(base::string16()); | 106 values.push_back(base::string16()); |
| 107 labels.push_back(base::string16()); | 107 labels.push_back(base::string16()); |
| 108 icons.push_back(base::string16()); | 108 icons.push_back(base::string16()); |
| 109 ids.push_back(POPUP_ITEM_ID_SEPARATOR); | 109 ids.push_back(POPUP_ITEM_ID_SEPARATOR); |
| 110 | 110 |
| 111 if (manager_->ShouldShowScanCreditCard(query_form_, query_field_)) { | 111 if (manager_->ShouldShowScanCreditCard(query_form_, query_field_)) { |
| 112 values.push_back(l10n_util::GetStringUTF16(IDS_AUTOFILL_SCAN_CREDIT_CARD)); | 112 values.push_back(l10n_util::GetStringUTF16(IDS_AUTOFILL_SCAN_CREDIT_CARD)); |
| 113 labels.push_back(base::string16()); | 113 labels.push_back(base::string16()); |
| 114 icons.push_back(base::string16()); | 114 icons.push_back(base::ASCIIToUTF16("scanCreditCardIcon")); |
| 115 ids.push_back(POPUP_ITEM_ID_SCAN_CREDIT_CARD); | 115 ids.push_back(POPUP_ITEM_ID_SCAN_CREDIT_CARD); |
| 116 } | 116 } |
| 117 | 117 |
| 118 // Only include "Autofill Options" special menu item if we have Autofill | 118 // Only include "Autofill Options" special menu item if we have Autofill |
| 119 // suggestions. | 119 // suggestions. |
| 120 has_suggestion_ = false; | 120 has_suggestion_ = false; |
| 121 for (size_t i = 0; i < ids.size(); ++i) { | 121 for (size_t i = 0; i < ids.size(); ++i) { |
| 122 if (ids[i] > 0) { | 122 if (ids[i] > 0) { |
| 123 has_suggestion_ = true; | 123 has_suggestion_ = true; |
| 124 break; | 124 break; |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 POPUP_ITEM_ID_DATALIST_ENTRY); | 433 POPUP_ITEM_ID_DATALIST_ENTRY); |
| 434 } | 434 } |
| 435 | 435 |
| 436 #if defined(OS_MACOSX) && !defined(OS_IOS) | 436 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 437 void AutofillExternalDelegate::PingRenderer() { | 437 void AutofillExternalDelegate::PingRenderer() { |
| 438 driver_->PingRenderer(); | 438 driver_->PingRenderer(); |
| 439 } | 439 } |
| 440 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 440 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
| 441 | 441 |
| 442 } // namespace autofill | 442 } // namespace autofill |
| OLD | NEW |