OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/passwords/account_chooser_more_combobox_model.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "chrome/grit/generated_resources.h" |
| 9 #include "ui/base/l10n/l10n_util.h" |
| 10 |
| 11 const int AccountChooserMoreComboboxModel::INDEX_MORE = 0; |
| 12 const int AccountChooserMoreComboboxModel::INDEX_LEARN_MORE = 1; |
| 13 const int AccountChooserMoreComboboxModel::INDEX_SETTINGS = 2; |
| 14 |
| 15 AccountChooserMoreComboboxModel::AccountChooserMoreComboboxModel() = default; |
| 16 |
| 17 AccountChooserMoreComboboxModel::~AccountChooserMoreComboboxModel() = default; |
| 18 |
| 19 int AccountChooserMoreComboboxModel::GetItemCount() const { |
| 20 return 3; |
| 21 } |
| 22 |
| 23 base::string16 AccountChooserMoreComboboxModel::GetItemAt(int index) { |
| 24 switch (index) { |
| 25 default: |
| 26 NOTREACHED(); |
| 27 case INDEX_MORE: |
| 28 return l10n_util::GetStringUTF16( |
| 29 IDS_CREDENTIAL_MANAGEMENT_ACCOUNT_CHOOSER_MORE); |
| 30 case INDEX_LEARN_MORE: |
| 31 return l10n_util::GetStringUTF16( |
| 32 IDS_CREDENTIAL_MANAGEMENT_ACCOUNT_CHOOSER_LEARN_MORE); |
| 33 case INDEX_SETTINGS: |
| 34 return l10n_util::GetStringUTF16( |
| 35 IDS_CREDENTIAL_MANAGEMENT_ACCOUNT_CHOOSER_PASSWORDS_LINK); |
| 36 } |
| 37 } |
| 38 |
| 39 bool AccountChooserMoreComboboxModel::IsItemSeparatorAt(int index) { |
| 40 return false; |
| 41 } |
| 42 |
| 43 int AccountChooserMoreComboboxModel::GetDefaultIndex() const { |
| 44 return 0; |
| 45 } |
| 46 |
| 47 bool AccountChooserMoreComboboxModel::IsItemEnabledAt(int index) const { |
| 48 return true; |
| 49 } |
OLD | NEW |