| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 ASH_SYSTEM_USER_USER_ACCOUNTS_DELEGATE_H_ | 5 #ifndef ASH_SYSTEM_USER_USER_ACCOUNTS_DELEGATE_H_ |
| 6 #define ASH_SYSTEM_USER_USER_ACCOUNTS_DELEGATE_H_ | 6 #define ASH_SYSTEM_USER_USER_ACCOUNTS_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 private: | 28 private: |
| 29 DISALLOW_COPY_AND_ASSIGN(Observer); | 29 DISALLOW_COPY_AND_ASSIGN(Observer); |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 UserAccountsDelegate(); | 32 UserAccountsDelegate(); |
| 33 virtual ~UserAccountsDelegate(); | 33 virtual ~UserAccountsDelegate(); |
| 34 | 34 |
| 35 void AddObserver(Observer* observer); | 35 void AddObserver(Observer* observer); |
| 36 void RemoveObserver(Observer* observer); | 36 void RemoveObserver(Observer* observer); |
| 37 | 37 |
| 38 // Returns the user's primary account as a canonicalized email address. | 38 // Returns the user's primary account's ID. |
| 39 virtual std::string GetPrimaryAccount() = 0; | 39 virtual std::string GetPrimaryAccountId() = 0; |
| 40 | 40 |
| 41 // Returns a list of the user's secondary accounts in form of canonicalized | 41 // Returns a list of the user's secondary accounts' IDs. |
| 42 // email addresses. | 42 virtual std::vector<std::string> GetSecondaryAccountIds() = 0; |
| 43 virtual std::vector<std::string> GetSecondaryAccountsList() = 0; | |
| 44 | 43 |
| 45 // Returns display name for given |account_id|. It has form of email but could | 44 // Returns display name for given |account_id|. |
| 46 // be uncanonical, e.g. account "test-user@gmail.com" could have display | |
| 47 // name "Test-user+AfterPlus@gmail.com". | |
| 48 virtual std::string GetAccountDisplayName(const std::string& account_id) = 0; | 45 virtual std::string GetAccountDisplayName(const std::string& account_id) = 0; |
| 49 | 46 |
| 50 // Deletes given |account_id| from the list of user's account. Passing | 47 // Deletes given |account_id| from the list of user's account. Passing |
| 51 // |account_id| that is not from list is no-op. | 48 // |account_id| that is not from list is no-op. |
| 52 virtual void DeleteAccount(const std::string& account_id) = 0; | 49 virtual void DeleteAccount(const std::string& account_id) = 0; |
| 53 | 50 |
| 54 // Launches a dialog which lets the user add a new account. | 51 // Launches a dialog which lets the user add a new account. |
| 55 virtual void LaunchAddAccountDialog() = 0; | 52 virtual void LaunchAddAccountDialog() = 0; |
| 56 | 53 |
| 57 protected: | 54 protected: |
| 58 void NotifyAccountListChanged(); | 55 void NotifyAccountListChanged(); |
| 59 | 56 |
| 60 private: | 57 private: |
| 61 ObserverList<Observer> observers_; | 58 ObserverList<Observer> observers_; |
| 62 | 59 |
| 63 DISALLOW_COPY_AND_ASSIGN(UserAccountsDelegate); | 60 DISALLOW_COPY_AND_ASSIGN(UserAccountsDelegate); |
| 64 }; | 61 }; |
| 65 | 62 |
| 66 } // namespace tray | 63 } // namespace tray |
| 67 } // namespace ash | 64 } // namespace ash |
| 68 | 65 |
| 69 #endif // ASH_SYSTEM_USER_USER_ACCOUNTS_DELEGATE_H_ | 66 #endif // ASH_SYSTEM_USER_USER_ACCOUNTS_DELEGATE_H_ |
| OLD | NEW |