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

Unified Diff: chrome/browser/ui/autofill/autofill_dialog_models.h

Issue 13331007: Multi-account AccountChooser for interactive autocomplete. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Indent fix. Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/autofill/autofill_dialog_models.h
diff --git a/chrome/browser/ui/autofill/autofill_dialog_models.h b/chrome/browser/ui/autofill/autofill_dialog_models.h
index 40841f9a0bca8a351f1138975f94e50c3b5c9fec..6a585be8b9f4ff9ea2a38f122214fa7c24d4b60b 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_models.h
+++ b/chrome/browser/ui/autofill/autofill_dialog_models.h
@@ -94,73 +94,6 @@ class SuggestionsMenuModel : public ui::SimpleMenuModel,
DISALLOW_COPY_AND_ASSIGN(SuggestionsMenuModel);
};
-// A delegate interface to allow the AccountChooserModel to inform its owner
-// of changes.
-class AccountChooserModelDelegate {
- public:
- virtual ~AccountChooserModelDelegate();
-
- // Called when the active account has changed.
- virtual void AccountChoiceChanged() = 0;
-};
-
-// A menu model for the account chooser. This allows users to switch between
-// using Wallet and local Autofill. TODO(estade): this should support multiple
-// Wallet accounts.
-class AccountChooserModel : public ui::SimpleMenuModel,
- public ui::SimpleMenuModel::Delegate {
- public:
- AccountChooserModel(AccountChooserModelDelegate* delegate,
- PrefService* prefs);
- virtual ~AccountChooserModel();
-
- // ui::SimpleMenuModel::Delegate implementation.
- virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
- virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
- virtual bool GetAcceleratorForCommandId(
- int command_id,
- ui::Accelerator* accelerator) OVERRIDE;
- virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE;
-
- // Should be called when the Wallet server returns an error.
- void SetHadWalletError();
-
- // Should be called when the Online Wallet sign-in attempt has failed.
- void SetHadWalletSigninError();
-
- bool had_wallet_error() const { return had_wallet_error_; }
-
- bool WalletIsSelected() const;
-
- int checked_item() const { return checked_item_; }
-
- private:
- void PrefChanged(const std::string& pref);
-
- // Sets |checked_item_| from the relevant pref.
- void UpdateCheckmarkFromPref();
-
- // Command IDs of the items in this menu. For now, we only support a single
- // account, so there's only one wallet item.
- static const int kWalletItemId;
- static const int kAutofillItemId;
-
- AccountChooserModelDelegate* account_delegate_;
-
- PrefService* prefs_;
-
- // The command id of the currently active item.
- int checked_item_;
-
- // Whether there has been a Wallet error while the owning dialog has been
- // open.
- bool had_wallet_error_;
-
- PrefChangeRegistrar pref_change_registrar_;
-
- DISALLOW_COPY_AND_ASSIGN(AccountChooserModel);
-};
-
// A model for possible months in the Gregorian calendar.
class MonthComboboxModel : public ui::ComboboxModel {
public:

Powered by Google App Engine
This is Rietveld 408576698