Chromium Code Reviews| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 should_show_cc_signin_promo_ = | 76 should_show_cc_signin_promo_ = |
| 77 manager_->ShouldShowCreditCardSigninPromo(query_form_, query_field_); | 77 manager_->ShouldShowCreditCardSigninPromo(query_form_, query_field_); |
| 78 } | 78 } |
| 79 | 79 |
| 80 void AutofillExternalDelegate::OnSuggestionsReturned( | 80 void AutofillExternalDelegate::OnSuggestionsReturned( |
| 81 int query_id, | 81 int query_id, |
| 82 const std::vector<Suggestion>& input_suggestions) { | 82 const std::vector<Suggestion>& input_suggestions) { |
| 83 if (query_id != query_id_) | 83 if (query_id != query_id_) |
| 84 return; | 84 return; |
| 85 | 85 |
| 86 std::vector<Suggestion> suggestions; | |
| 87 | |
| 88 if (IsHintBeforeKeyboardAccessorySuggestions()) { | |
|
please use gerrit instead
2017/05/15 14:37:29
#if defined(OS_ANDROID)
csashi
2017/05/15 20:07:26
Done.
| |
| 89 Suggestion create_icon; | |
| 90 create_icon.icon = base::ASCIIToUTF16("create"); | |
| 91 suggestions.push_back(create_icon); | |
| 92 } | |
| 93 | |
| 86 // The suggestions and warnings are "above the fold" and are separated from | 94 // The suggestions and warnings are "above the fold" and are separated from |
| 87 // other menu items with a separator. | 95 // other menu items with a separator. |
| 88 std::vector<Suggestion> suggestions(input_suggestions); | 96 suggestions.insert(suggestions.end(), input_suggestions.begin(), |
| 97 input_suggestions.end()); | |
| 89 // Hide warnings as appropriate. | 98 // Hide warnings as appropriate. |
| 90 PossiblyRemoveAutofillWarnings(&suggestions); | 99 PossiblyRemoveAutofillWarnings(&suggestions); |
| 91 | 100 |
| 92 #if !defined(OS_ANDROID) | 101 #if !defined(OS_ANDROID) |
| 93 // If there are above the fold suggestions at this point, add a separator to | 102 // If there are above the fold suggestions at this point, add a separator to |
| 94 // go between the values and menu items. | 103 // go between the values and menu items. |
| 95 if (!suggestions.empty()) { | 104 if (!suggestions.empty()) { |
| 96 suggestions.push_back(Suggestion()); | 105 suggestions.push_back(Suggestion()); |
| 97 suggestions.back().frontend_id = POPUP_ITEM_ID_SEPARATOR; | 106 suggestions.back().frontend_id = POPUP_ITEM_ID_SEPARATOR; |
| 98 } | 107 } |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 395 const { | 404 const { |
| 396 if (IsKeyboardAccessoryEnabled()) { | 405 if (IsKeyboardAccessoryEnabled()) { |
| 397 return l10n_util::GetStringUTF16(IDS_AUTOFILL_OPTIONS_CONTENT_DESCRIPTION); | 406 return l10n_util::GetStringUTF16(IDS_AUTOFILL_OPTIONS_CONTENT_DESCRIPTION); |
| 398 } | 407 } |
| 399 return l10n_util::GetStringUTF16(is_credit_card_popup_ ? | 408 return l10n_util::GetStringUTF16(is_credit_card_popup_ ? |
| 400 IDS_AUTOFILL_CREDIT_CARD_OPTIONS_POPUP : | 409 IDS_AUTOFILL_CREDIT_CARD_OPTIONS_POPUP : |
| 401 IDS_AUTOFILL_OPTIONS_POPUP); | 410 IDS_AUTOFILL_OPTIONS_POPUP); |
| 402 } | 411 } |
| 403 | 412 |
| 404 } // namespace autofill | 413 } // namespace autofill |
| OLD | NEW |