| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_SYNC_UTIL_USER_SETTINGS_H_ | 5 #ifndef CHROME_BROWSER_SYNC_UTIL_USER_SETTINGS_H_ |
| 6 #define CHROME_BROWSER_SYNC_UTIL_USER_SETTINGS_H_ | 6 #define CHROME_BROWSER_SYNC_UTIL_USER_SETTINGS_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
| 13 #include "base/lock.h" | 13 #include "base/lock.h" |
| 14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 15 #include "chrome/browser/sync/util/sync_types.h" | 15 #include "chrome/browser/sync/util/sync_types.h" |
| 16 #include "chrome/common/net/gaia/signin.h" | |
| 17 | 16 |
| 18 extern "C" struct sqlite3; | 17 extern "C" struct sqlite3; |
| 19 | 18 |
| 20 namespace browser_sync { | 19 namespace browser_sync { |
| 21 | 20 |
| 22 void ExecOrDie(sqlite3* dbhandle, const char *query); | 21 void ExecOrDie(sqlite3* dbhandle, const char *query); |
| 23 std::string APEncode(const std::string& in); | 22 std::string APEncode(const std::string& in); |
| 24 std::string APDecode(const std::string& in); | 23 std::string APDecode(const std::string& in); |
| 25 | 24 |
| 26 class URLFactory; | 25 class URLFactory; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 52 | 51 |
| 53 // Returns the user name whose credentials have been persisted. | 52 // Returns the user name whose credentials have been persisted. |
| 54 bool GetLastUser(std::string* username); | 53 bool GetLastUser(std::string* username); |
| 55 | 54 |
| 56 // Returns the user name whose credentials have been persisted as well as a | 55 // Returns the user name whose credentials have been persisted as well as a |
| 57 // service token for the named service | 56 // service token for the named service |
| 58 bool GetLastUserAndServiceToken(const std::string& service_name, | 57 bool GetLastUserAndServiceToken(const std::string& service_name, |
| 59 std::string* username, | 58 std::string* username, |
| 60 std::string* service_token); | 59 std::string* service_token); |
| 61 | 60 |
| 62 void RememberSigninType(const std::string& signin, gaia::SignIn signin_type); | |
| 63 gaia::SignIn RecallSigninType(const std::string& signin, | |
| 64 gaia::SignIn default_type); | |
| 65 | |
| 66 void RemoveAllGuestSettings(); | 61 void RemoveAllGuestSettings(); |
| 67 | 62 |
| 68 void StoreEmailForSignin(const std::string& signin, | 63 void StoreEmailForSignin(const std::string& signin, |
| 69 const std::string& primary_email); | 64 const std::string& primary_email); |
| 70 | 65 |
| 71 // Multiple email addresses can map to the same Google Account. This method | 66 // Multiple email addresses can map to the same Google Account. This method |
| 72 // returns the primary Google Account email associated with |signin|, which | 67 // returns the primary Google Account email associated with |signin|, which |
| 73 // is used as both input and output. | 68 // is used as both input and output. |
| 74 bool GetEmailForSignin(std::string* signin); | 69 bool GetEmailForSignin(std::string* signin); |
| 75 | 70 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 typedef std::map<std::string, std::string> ServiceTokenMap; | 103 typedef std::map<std::string, std::string> ServiceTokenMap; |
| 109 ServiceTokenMap service_tokens_; | 104 ServiceTokenMap service_tokens_; |
| 110 #endif // OS_WIN | 105 #endif // OS_WIN |
| 111 | 106 |
| 112 DISALLOW_COPY_AND_ASSIGN(UserSettings); | 107 DISALLOW_COPY_AND_ASSIGN(UserSettings); |
| 113 }; | 108 }; |
| 114 | 109 |
| 115 } // namespace browser_sync | 110 } // namespace browser_sync |
| 116 | 111 |
| 117 #endif // CHROME_BROWSER_SYNC_UTIL_USER_SETTINGS_H_ | 112 #endif // CHROME_BROWSER_SYNC_UTIL_USER_SETTINGS_H_ |
| OLD | NEW |