Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(425)

Side by Side Diff: chrome/browser/ui/passwords/account_chooser_more_combobox_model.cc

Issue 908493002: Add a ComboboxModel and strings for the account chooser's "More" button. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/passwords/account_chooser_more_combobox_model.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698