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 COMPONENTS_SIGNIN_CORE_BROWSER_GAIA_COOKIE_MANAGER_SERVICE_H_ | 5 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_GAIA_COOKIE_MANAGER_SERVICE_H_ |
6 #define COMPONENTS_SIGNIN_CORE_BROWSER_GAIA_COOKIE_MANAGER_SERVICE_H_ | 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_GAIA_COOKIE_MANAGER_SERVICE_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <map> | 9 #include <map> |
10 #include <memory> | 10 #include <memory> |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 GaiaCookieRequestType request_type_; | 74 GaiaCookieRequestType request_type_; |
75 std::string account_id_; | 75 std::string account_id_; |
76 std::string source_; | 76 std::string source_; |
77 }; | 77 }; |
78 | 78 |
79 class Observer { | 79 class Observer { |
80 public: | 80 public: |
81 // Called whenever a merge session is completed. The account that was | 81 // Called whenever a merge session is completed. The account that was |
82 // merged is given by |account_id|. If |error| is equal to | 82 // merged is given by |account_id|. If |error| is equal to |
83 // GoogleServiceAuthError::AuthErrorNone() then the merge succeeeded. | 83 // GoogleServiceAuthError::AuthErrorNone() then the merge succeeded. |
84 virtual void OnAddAccountToCookieCompleted( | 84 virtual void OnAddAccountToCookieCompleted( |
85 const std::string& account_id, | 85 const std::string& account_id, |
86 const GoogleServiceAuthError& error) {} | 86 const GoogleServiceAuthError& error) {} |
87 | 87 |
| 88 // Called whenever a logout is completed. If |error| is equal to |
| 89 // GoogleServiceAuthError::AuthErrorNone() then the logout succeeded. |
| 90 virtual void OnLogOutAccountsFromCookieCompleted( |
| 91 const GoogleServiceAuthError& error) {} |
| 92 |
88 // Called whenever the GaiaCookieManagerService's list of GAIA accounts is | 93 // Called whenever the GaiaCookieManagerService's list of GAIA accounts is |
89 // updated. The GCMS monitors the APISID cookie and triggers a /ListAccounts | 94 // updated. The GCMS monitors the APISID cookie and triggers a /ListAccounts |
90 // call on change. The GCMS will also call ListAccounts upon the first call | 95 // call on change. The GCMS will also call ListAccounts upon the first call |
91 // to ListAccounts(). The GCMS will delay calling ListAccounts if other | 96 // to ListAccounts(). The GCMS will delay calling ListAccounts if other |
92 // requests are in queue that would modify the APISID cookie. | 97 // requests are in queue that would modify the APISID cookie. |
93 // If the ListAccounts call fails and the GCMS cannot recover, the reason | 98 // If the ListAccounts call fails and the GCMS cannot recover, the reason |
94 // is passed in |error|. | 99 // is passed in |error|. |
95 virtual void OnGaiaAccountsInCookieUpdated( | 100 virtual void OnGaiaAccountsInCookieUpdated( |
96 const std::vector<gaia::ListedAccount>& accounts, | 101 const std::vector<gaia::ListedAccount>& accounts, |
97 const std::vector<gaia::ListedAccount>& signed_out_accounts, | 102 const std::vector<gaia::ListedAccount>& signed_out_accounts, |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 | 321 |
317 std::vector<gaia::ListedAccount> listed_accounts_; | 322 std::vector<gaia::ListedAccount> listed_accounts_; |
318 std::vector<gaia::ListedAccount> signed_out_accounts_; | 323 std::vector<gaia::ListedAccount> signed_out_accounts_; |
319 | 324 |
320 bool list_accounts_stale_; | 325 bool list_accounts_stale_; |
321 | 326 |
322 DISALLOW_COPY_AND_ASSIGN(GaiaCookieManagerService); | 327 DISALLOW_COPY_AND_ASSIGN(GaiaCookieManagerService); |
323 }; | 328 }; |
324 | 329 |
325 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_GAIA_COOKIE_MANAGER_SERVICE_H_ | 330 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_GAIA_COOKIE_MANAGER_SERVICE_H_ |
OLD | NEW |