OLD | NEW |
---|---|
(Empty) | |
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. | |
4 | |
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.
| |
5 #include <string> | |
6 #include <vector> | |
7 | |
8 #include "ash/ash_export.h" | |
9 #include "base/macros.h" | |
10 #include "base/observer_list.h" | |
11 | |
12 namespace ash { | |
13 namespace tray { | |
14 | |
15 class ASH_EXPORT UserAccountsDelegate { | |
16 public: | |
17 class Observer { | |
18 public: | |
19 Observer() {} | |
20 virtual ~Observer() {} | |
21 | |
22 // 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.
| |
23 virtual void AccountListChanged() = 0; | |
24 | |
25 private: | |
26 DISALLOW_COPY_AND_ASSIGN(Observer); | |
27 }; | |
28 | |
29 UserAccountsDelegate(); | |
30 virtual ~UserAccountsDelegate(); | |
31 | |
32 void AddObserver(Observer* observer); | |
33 void RemoveObserver(Observer* observer); | |
34 | |
35 // 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.
| |
36 virtual std::string GetPrimaryAccount() = 0; | |
37 | |
38 // Returns list of user's secondary accounts. They have form of canonized | |
39 // 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.
| |
40 virtual std::vector<std::string> GetSecondaryAccountsList() = 0; | |
41 | |
42 // Returns display name for given |account_id|. It has form of email but could | |
43 // 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
| |
44 // name "Test-user+AfterPlus@gmail.com". | |
45 virtual std::string GetAccountDisplayName(const std::string& account_id) = 0; | |
46 | |
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; | |
50 | |
51 // 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.
| |
52 virtual void LaunchAddAccountDialog() = 0; | |
53 | |
54 protected: | |
55 void NotifyAccountListChanged(); | |
56 | |
57 private: | |
58 ObserverList<Observer> observers_; | |
59 | |
60 DISALLOW_COPY_AND_ASSIGN(UserAccountsDelegate); | |
61 }; | |
62 | |
63 } // namespace tray | |
64 } // namespace ash | |
OLD | NEW |