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 #ifndef CHROME_BROWSER_UI_AUTOFILL_ACCOUNT_CHOOSER_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_ACCOUNT_CHOOSER_MODEL_H_ |
6 #define CHROME_BROWSER_UI_AUTOFILL_ACCOUNT_CHOOSER_MODEL_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_ACCOUNT_CHOOSER_MODEL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // Online Wallet accounts and local Autofill data. | 35 // Online Wallet accounts and local Autofill data. |
36 // Terminology: | 36 // Terminology: |
37 // - "Active Wallet account": the account used for communications with the | 37 // - "Active Wallet account": the account used for communications with the |
38 // Online Wallet service. There may be multiple signed-in accounts, but at any | 38 // Online Wallet service. There may be multiple signed-in accounts, but at any |
39 // point of time at most one of is active. | 39 // point of time at most one of is active. |
40 class AccountChooserModel : public ui::SimpleMenuModel, | 40 class AccountChooserModel : public ui::SimpleMenuModel, |
41 public ui::SimpleMenuModel::Delegate { | 41 public ui::SimpleMenuModel::Delegate { |
42 public: | 42 public: |
43 AccountChooserModel(AccountChooserModelDelegate* delegate, | 43 AccountChooserModel(AccountChooserModelDelegate* delegate, |
44 PrefService* prefs, | 44 PrefService* prefs, |
45 const AutofillMetrics& metric_logger, | 45 const AutofillMetrics& metric_logger); |
46 DialogType dialog_type); | |
47 virtual ~AccountChooserModel(); | 46 virtual ~AccountChooserModel(); |
48 | 47 |
49 // ui::SimpleMenuModel::Delegate implementation. | 48 // ui::SimpleMenuModel::Delegate implementation. |
50 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | 49 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; |
51 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; | 50 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; |
52 virtual bool GetAcceleratorForCommandId( | 51 virtual bool GetAcceleratorForCommandId( |
53 int command_id, | 52 int command_id, |
54 ui::Accelerator* accelerator) OVERRIDE; | 53 ui::Accelerator* accelerator) OVERRIDE; |
55 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; | 54 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; |
56 | 55 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 AccountChooserModelDelegate* delegate_; | 110 AccountChooserModelDelegate* delegate_; |
112 | 111 |
113 // The command id of the currently selected item. | 112 // The command id of the currently selected item. |
114 int checked_item_; | 113 int checked_item_; |
115 | 114 |
116 // Whether there has been a Wallet error. | 115 // Whether there has been a Wallet error. |
117 bool had_wallet_error_; | 116 bool had_wallet_error_; |
118 | 117 |
119 // For logging UMA metrics. | 118 // For logging UMA metrics. |
120 const AutofillMetrics& metric_logger_; | 119 const AutofillMetrics& metric_logger_; |
121 const DialogType dialog_type_; | |
122 | 120 |
123 // The name (email) of the account currently used in communications with the | 121 // The name (email) of the account currently used in communications with the |
124 // Online Wallet service. | 122 // Online Wallet service. |
125 string16 active_wallet_account_name_; | 123 string16 active_wallet_account_name_; |
126 | 124 |
127 DISALLOW_COPY_AND_ASSIGN(AccountChooserModel); | 125 DISALLOW_COPY_AND_ASSIGN(AccountChooserModel); |
128 }; | 126 }; |
129 | 127 |
130 } // namespace autofill | 128 } // namespace autofill |
131 | 129 |
132 #endif // CHROME_BROWSER_UI_AUTOFILL_ACCOUNT_CHOOSER_MODEL_H_ | 130 #endif // CHROME_BROWSER_UI_AUTOFILL_ACCOUNT_CHOOSER_MODEL_H_ |
OLD | NEW |