Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2586)

Unified Diff: chrome/browser/sync/util/user_settings_win.cc

Issue 8636020: Remove obsolete UserSettings class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/util/user_settings_unittest.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/util/user_settings_win.cc
diff --git a/chrome/browser/sync/util/user_settings_win.cc b/chrome/browser/sync/util/user_settings_win.cc
deleted file mode 100644
index 9620f36699feb359e9ba71f19e6adea7868baca0..0000000000000000000000000000000000000000
--- a/chrome/browser/sync/util/user_settings_win.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/sync/util/user_settings.h"
-
-#include <string>
-
-#include "base/logging.h"
-#include "chrome/browser/sync/util/data_encryption.h"
-#include "chrome/browser/sync/util/sqlite_utils.h"
-
-using std::string;
-
-namespace browser_sync {
-
-void UserSettings::SetAuthTokenForService(const string& email,
- const string& service_name, const string& long_lived_service_token) {
- ScopedDBHandle dbhandle(this);
- sqlite_utils::SQLStatement statement;
- statement.prepare(dbhandle.get(),
- "INSERT INTO cookies "
- "(email, service_name, service_token) "
- "values (?, ?, ?)");
- statement.bind_string(0, email);
- statement.bind_string(1, service_name);
- statement.bind_blob(2, &EncryptData(long_lived_service_token));
- if (SQLITE_DONE != statement.step()) {
- LOG(FATAL) << sqlite3_errmsg(dbhandle.get());
- }
-}
-
-// Returns the username whose credentials have been persisted as well as
-// a service token for the named service.
-bool UserSettings::GetLastUserAndServiceToken(const string& service_name,
- string* username,
- string* service_token) {
- ScopedDBHandle dbhandle(this);
- sqlite_utils::SQLStatement query;
- query.prepare(dbhandle.get(),
- "SELECT email, service_token FROM cookies"
- " WHERE service_name = ?");
- query.bind_string(0, service_name.c_str());
-
- if (SQLITE_ROW == query.step()) {
- *username = query.column_string(0);
-
- std::vector<uint8> encrypted_service_token;
- query.column_blob_as_vector(1, &encrypted_service_token);
- DecryptData(encrypted_service_token, service_token);
- return true;
- }
-
- return false;
-}
-
-} // namespace browser_sync
« no previous file with comments | « chrome/browser/sync/util/user_settings_unittest.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698