| 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.
|
| +
|
| +#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.
|
| + 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.
|
| + virtual std::string GetPrimaryAccount() = 0;
|
| +
|
| + // Returns list of user's secondary accounts. They have form of canonized
|
| + // emails.
|
| + 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
|
| + // 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.
|
| + virtual void LaunchAddAccountDialog() = 0;
|
| +
|
| + protected:
|
| + void NotifyAccountListChanged();
|
| +
|
| + private:
|
| + ObserverList<Observer> observers_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(UserAccountsDelegate);
|
| +};
|
| +
|
| +} // namespace tray
|
| +} // namespace ash
|
|
|