OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/sync/util/user_settings.h" | 5 #include "chrome/browser/sync/util/user_settings.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "chrome/browser/sync/util/crypto_helpers.h" | |
11 #include "chrome/browser/sync/util/data_encryption.h" | 10 #include "chrome/browser/sync/util/data_encryption.h" |
12 #include "chrome/common/sqlite_utils.h" | 11 #include "chrome/common/sqlite_utils.h" |
13 | 12 |
14 using std::string; | 13 using std::string; |
15 | 14 |
16 namespace browser_sync { | 15 namespace browser_sync { |
17 | 16 |
18 void UserSettings::SetAuthTokenForService(const string& email, | 17 void UserSettings::SetAuthTokenForService(const string& email, |
19 const string& service_name, const string& long_lived_service_token) { | 18 const string& service_name, const string& long_lived_service_token) { |
20 ScopedDBHandle dbhandle(this); | 19 ScopedDBHandle dbhandle(this); |
(...skipping 28 matching lines...) Expand all Loading... |
49 std::vector<uint8> encrypted_service_token; | 48 std::vector<uint8> encrypted_service_token; |
50 query.column_blob_as_vector(1, &encrypted_service_token); | 49 query.column_blob_as_vector(1, &encrypted_service_token); |
51 DecryptData(encrypted_service_token, service_token); | 50 DecryptData(encrypted_service_token, service_token); |
52 return true; | 51 return true; |
53 } | 52 } |
54 | 53 |
55 return false; | 54 return false; |
56 } | 55 } |
57 | 56 |
58 } // namespace browser_sync | 57 } // namespace browser_sync |
OLD | NEW |