1 // Copyright 2014 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.
5 #ifndef ASH_SYSTEM_USER_USER_ACCOUNTS_DELEGATE_H_
6 #define ASH_SYSTEM_USER_USER_ACCOUNTS_DELEGATE_H_
11 #include "ash/ash_export.h"
12 #include "base/macros.h"
13 #include "base/observer_list.h"
18 class ASH_EXPORT UserAccountsDelegate
{
23 virtual ~Observer() {}
25 // Called when the account list of user has been changed.
26 virtual void AccountListChanged() = 0;
29 DISALLOW_COPY_AND_ASSIGN(Observer
);
32 UserAccountsDelegate();
33 virtual ~UserAccountsDelegate();
35 void AddObserver(Observer
* observer
);
36 void RemoveObserver(Observer
* observer
);
38 // Returns the user's primary account's ID.
39 virtual std::string
GetPrimaryAccountId() = 0;
41 // Returns a list of the user's secondary accounts' IDs.
42 virtual std::vector
<std::string
> GetSecondaryAccountIds() = 0;
44 // Returns display name for given |account_id|.
45 virtual std::string
GetAccountDisplayName(const std::string
& account_id
) = 0;
47 // Deletes given |account_id| from the list of user's account. Passing
48 // |account_id| that is not from list is no-op.
49 virtual void DeleteAccount(const std::string
& account_id
) = 0;
51 // Launches a dialog which lets the user add a new account.
52 virtual void LaunchAddAccountDialog() = 0;
55 void NotifyAccountListChanged();
58 ObserverList
<Observer
> observers_
;
60 DISALLOW_COPY_AND_ASSIGN(UserAccountsDelegate
);
66 #endif // ASH_SYSTEM_USER_USER_ACCOUNTS_DELEGATE_H_