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/i18n/case_conversion.h" | 9 #include "base/i18n/case_conversion.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 // TODO(rouslan): Remove manual upper-casing when keyboard accessory becomes | 286 // TODO(rouslan): Remove manual upper-casing when keyboard accessory becomes |
287 // default on Android. | 287 // default on Android. |
288 if (IsKeyboardAccessoryEnabled()) | 288 if (IsKeyboardAccessoryEnabled()) |
289 value = base::i18n::ToUpper(value); | 289 value = base::i18n::ToUpper(value); |
290 | 290 |
291 suggestions->push_back(Suggestion(value)); | 291 suggestions->push_back(Suggestion(value)); |
292 suggestions->back().frontend_id = POPUP_ITEM_ID_CLEAR_FORM; | 292 suggestions->back().frontend_id = POPUP_ITEM_ID_CLEAR_FORM; |
293 } | 293 } |
294 | 294 |
295 // Append the 'Chrome Autofill options' menu item; | 295 // Append the 'Chrome Autofill options' menu item; |
296 suggestions->push_back(Suggestion( | 296 // TODO(rouslan): Switch on the platform in the GRD file when keyboard |
297 l10n_util::GetStringUTF16(IDS_AUTOFILL_OPTIONS_POPUP))); | 297 // accessory becomes default on Android. |
| 298 suggestions->push_back(Suggestion(l10n_util::GetStringUTF16( |
| 299 IsKeyboardAccessoryEnabled() ? IDS_AUTOFILL_OPTIONS_CONTENT_DESCRIPTION |
| 300 : IDS_AUTOFILL_OPTIONS_POPUP))); |
298 suggestions->back().frontend_id = POPUP_ITEM_ID_AUTOFILL_OPTIONS; | 301 suggestions->back().frontend_id = POPUP_ITEM_ID_AUTOFILL_OPTIONS; |
299 if (IsKeyboardAccessoryEnabled()) | 302 if (IsKeyboardAccessoryEnabled()) |
300 suggestions->back().icon = base::ASCIIToUTF16("settings"); | 303 suggestions->back().icon = base::ASCIIToUTF16("settings"); |
301 } | 304 } |
302 | 305 |
303 void AutofillExternalDelegate::InsertDataListValues( | 306 void AutofillExternalDelegate::InsertDataListValues( |
304 std::vector<Suggestion>* suggestions) { | 307 std::vector<Suggestion>* suggestions) { |
305 if (data_list_values_.empty()) | 308 if (data_list_values_.empty()) |
306 return; | 309 return; |
307 | 310 |
(...skipping 10 matching lines...) Expand all Loading... |
318 suggestions->insert(suggestions->begin(), data_list_values_.size(), | 321 suggestions->insert(suggestions->begin(), data_list_values_.size(), |
319 Suggestion()); | 322 Suggestion()); |
320 for (size_t i = 0; i < data_list_values_.size(); i++) { | 323 for (size_t i = 0; i < data_list_values_.size(); i++) { |
321 (*suggestions)[i].value = data_list_values_[i]; | 324 (*suggestions)[i].value = data_list_values_[i]; |
322 (*suggestions)[i].label = data_list_labels_[i]; | 325 (*suggestions)[i].label = data_list_labels_[i]; |
323 (*suggestions)[i].frontend_id = POPUP_ITEM_ID_DATALIST_ENTRY; | 326 (*suggestions)[i].frontend_id = POPUP_ITEM_ID_DATALIST_ENTRY; |
324 } | 327 } |
325 } | 328 } |
326 | 329 |
327 } // namespace autofill | 330 } // namespace autofill |
OLD | NEW |