Chromium Code Reviews| Index: ash/system/user/user_accounts_delegate.h |
| diff --git a/ash/system/user/user_accounts_delegate.h b/ash/system/user/user_accounts_delegate.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7521bfde6e91a2bbbd920acfd5cab9080122bde9 |
| --- /dev/null |
| +++ b/ash/system/user/user_accounts_delegate.h |
| @@ -0,0 +1,64 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
|
Mr4D (OOO till 08-26)
2014/03/26 16:49:54
Can you please add the include guards here?
dzhioev (left Google)
2014/03/26 23:48:52
Done.
|
| +#include <string> |
| +#include <vector> |
| + |
| +#include "ash/ash_export.h" |
| +#include "base/macros.h" |
| +#include "base/observer_list.h" |
| + |
| +namespace ash { |
| +namespace tray { |
| + |
| +class ASH_EXPORT UserAccountsDelegate { |
| + public: |
| + class Observer { |
| + public: |
| + Observer() {} |
| + virtual ~Observer() {} |
| + |
| + // Called when account list of user has been changed. |
|
Mr4D (OOO till 08-26)
2014/03/26 16:49:54
.. when the account ..
dzhioev (left Google)
2014/03/26 23:48:52
Done.
|
| + virtual void AccountListChanged() = 0; |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(Observer); |
| + }; |
| + |
| + UserAccountsDelegate(); |
| + virtual ~UserAccountsDelegate(); |
| + |
| + void AddObserver(Observer* observer); |
| + void RemoveObserver(Observer* observer); |
| + |
| + // Returns user's primary account. It has form of canonized email. |
|
Mr4D (OOO till 08-26)
2014/03/26 16:49:54
Returns the user's primary account as a canonicali
dzhioev (left Google)
2014/03/26 23:48:52
Done.
|
| + virtual std::string GetPrimaryAccount() = 0; |
| + |
| + // Returns list of user's secondary accounts. They have form of canonized |
| + // emails. |
|
Mr4D (OOO till 08-26)
2014/03/26 16:49:54
Returns a list of the user's secondary accounts in
dzhioev (left Google)
2014/03/26 23:48:52
Done.
|
| + virtual std::vector<std::string> GetSecondaryAccountsList() = 0; |
| + |
| + // Returns display name for given |account_id|. It has form of email but could |
| + // be not cananized, e.g. account "test-user@gmail.com" could have display |
|
Mr4D (OOO till 08-26)
2014/03/26 16:49:54
.. but could not be canonicalized, ..
dzhioev (left Google)
2014/03/26 23:48:52
I think "but could not be canonicalized" is not wh
|
| + // name "Test-user+AfterPlus@gmail.com". |
| + virtual std::string GetAccountDisplayName(const std::string& account_id) = 0; |
| + |
| + // Deletes given |account_id| from the list of user's account. Passing |
| + // |account_id| that is not from list is no-op. |
| + virtual void DeleteAccount(const std::string& account_id) = 0; |
| + |
| + // Launches dialog that offers user to add the new account. |
|
Mr4D (OOO till 08-26)
2014/03/26 16:49:54
Launches a dialog which lets the user add a new ac
dzhioev (left Google)
2014/03/26 23:48:52
Done.
|
| + virtual void LaunchAddAccountDialog() = 0; |
| + |
| + protected: |
| + void NotifyAccountListChanged(); |
| + |
| + private: |
| + ObserverList<Observer> observers_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(UserAccountsDelegate); |
| +}; |
| + |
| +} // namespace tray |
| +} // namespace ash |