| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_SIGNIN_SIGNIN_NAMES_IO_THREAD_H_ | 5 #ifndef CHROME_BROWSER_SIGNIN_SIGNIN_NAMES_IO_THREAD_H_ |
| 6 #define CHROME_BROWSER_SIGNIN_SIGNIN_NAMES_IO_THREAD_H_ | 6 #define CHROME_BROWSER_SIGNIN_SIGNIN_NAMES_IO_THREAD_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // Gets the set of email addresses of connected profiles. This method should | 35 // Gets the set of email addresses of connected profiles. This method should |
| 36 // only be called on the IO thread. | 36 // only be called on the IO thread. |
| 37 const EmailSet& GetEmails() const; | 37 const EmailSet& GetEmails() const; |
| 38 | 38 |
| 39 // Releases all resource held by object. Once released, GetEmails() no | 39 // Releases all resource held by object. Once released, GetEmails() no |
| 40 // longer works. | 40 // longer works. |
| 41 void ReleaseResourcesOnUIThread(); | 41 void ReleaseResourcesOnUIThread(); |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 // SigninManagerBase::Observer: | 44 // SigninManagerBase::Observer: |
| 45 virtual void GoogleSigninSucceeded(const std::string& username, | 45 virtual void GoogleSigninSucceeded(const std::string& account_id, |
| 46 const std::string& username, |
| 46 const std::string& password) OVERRIDE; | 47 const std::string& password) OVERRIDE; |
| 47 virtual void GoogleSignedOut(const std::string& username) OVERRIDE; | 48 virtual void GoogleSignedOut(const std::string& account_id, |
| 49 const std::string& username) OVERRIDE; |
| 48 | 50 |
| 49 // SigninManagerFactory::Observer: | 51 // SigninManagerFactory::Observer: |
| 50 virtual void SigninManagerCreated(SigninManagerBase* manager) OVERRIDE; | 52 virtual void SigninManagerCreated(SigninManagerBase* manager) OVERRIDE; |
| 51 virtual void SigninManagerShutdown(SigninManagerBase* manager) OVERRIDE; | 53 virtual void SigninManagerShutdown(SigninManagerBase* manager) OVERRIDE; |
| 52 | 54 |
| 53 // Checks whether the current thread is the IO thread. | 55 // Checks whether the current thread is the IO thread. |
| 54 void CheckOnIOThread() const; | 56 void CheckOnIOThread() const; |
| 55 | 57 |
| 56 // Checks whether the current thread is the UI thread. | 58 // Checks whether the current thread is the UI thread. |
| 57 void CheckOnUIThread() const; | 59 void CheckOnUIThread() const; |
| 58 | 60 |
| 59 // Posts a task to the I/O thread to add or remove the email address from | 61 // Posts a task to the I/O thread to add or remove the email address from |
| 60 // the set. | 62 // the set. |
| 61 void PostTaskToIOThread(bool add, const base::string16& email); | 63 void PostTaskToIOThread(bool add, const base::string16& email); |
| 62 | 64 |
| 63 // Updates the email set on the I/O thread. Protected for testing. | 65 // Updates the email set on the I/O thread. Protected for testing. |
| 64 void UpdateOnIOThread(bool add, const base::string16& email); | 66 void UpdateOnIOThread(bool add, const base::string16& email); |
| 65 | 67 |
| 66 EmailSet emails_; | 68 EmailSet emails_; |
| 67 | 69 |
| 68 // The set of SigninManagerBase instances that this instance is currently | 70 // The set of SigninManagerBase instances that this instance is currently |
| 69 // observing. Can only be accessed on the UI thread. | 71 // observing. Can only be accessed on the UI thread. |
| 70 std::set<SigninManagerBase*> observed_managers_; | 72 std::set<SigninManagerBase*> observed_managers_; |
| 71 bool resources_released_; | 73 bool resources_released_; |
| 72 | 74 |
| 73 DISALLOW_COPY_AND_ASSIGN(SigninNamesOnIOThread); | 75 DISALLOW_COPY_AND_ASSIGN(SigninNamesOnIOThread); |
| 74 }; | 76 }; |
| 75 | 77 |
| 76 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_NAMES_IO_THREAD_H_ | 78 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_NAMES_IO_THREAD_H_ |
| OLD | NEW |