summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/token_migrator.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/sync/token_migrator.cc')
-rw-r--r--chrome/browser/sync/token_migrator.cc53
1 files changed, 0 insertions, 53 deletions
diff --git a/chrome/browser/sync/token_migrator.cc b/chrome/browser/sync/token_migrator.cc
deleted file mode 100644
index 084bc40..0000000
--- a/chrome/browser/sync/token_migrator.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2010 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/token_migrator.h"
-
-#include "chrome/browser/sync/profile_sync_service.h"
-#include "chrome/browser/sync/util/user_settings.h"
-#include "chrome/common/net/gaia/gaia_constants.h"
-
-const FilePath::CharType kSyncDataFolderName[] =
- FILE_PATH_LITERAL("Sync Data");
-
-const FilePath::CharType kBookmarkSyncUserSettingsDatabase[] =
- FILE_PATH_LITERAL("BookmarkSyncSettings.sqlite3");
-
-using browser_sync::UserSettings;
-
-TokenMigrator::TokenMigrator(ProfileSyncService* service,
- const FilePath& profile_path)
- : service_(service),
- database_location_(profile_path.Append(kSyncDataFolderName)) {
-}
-
-TokenMigrator::~TokenMigrator() {
-}
-
-void TokenMigrator::TryMigration() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
- ChromeThread::PostTask(ChromeThread::DB, FROM_HERE,
- NewRunnableMethod(this, &TokenMigrator::LoadTokens));
-}
-
-void TokenMigrator::LoadTokens() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB));
- scoped_ptr<UserSettings> user_settings(new UserSettings());
- FilePath settings_db_file =
- database_location_.Append(FilePath(kBookmarkSyncUserSettingsDatabase));
- if (!user_settings->Init(settings_db_file))
- return;
-
- if (!user_settings->GetLastUserAndServiceToken(GaiaConstants::kSyncService,
- &username_, &token_))
- return;
-
- ChromeThread::PostTask(ChromeThread::UI, FROM_HERE,
- NewRunnableMethod(this, &TokenMigrator::PostTokensBack));
-}
-
-void TokenMigrator::PostTokensBack() {
- DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
- service_->LoadMigratedCredentials(username_, token_);
-}