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

Unified Diff: chrome/browser/chromeos/login/managed/locally_managed_user_login_flow.cc

Issue 101283003: Add first implemenation for SU password sync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits Created 7 years 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
Index: chrome/browser/chromeos/login/managed/locally_managed_user_login_flow.cc
diff --git a/chrome/browser/chromeos/login/managed/locally_managed_user_login_flow.cc b/chrome/browser/chromeos/login/managed/locally_managed_user_login_flow.cc
deleted file mode 100644
index f4a4f25ebc133ed8ee873b738fc53fe6f8b29c78..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/login/managed/locally_managed_user_login_flow.cc
+++ /dev/null
@@ -1,105 +0,0 @@
-// Copyright (c) 2012 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/chromeos/login/managed/locally_managed_user_login_flow.h"
-
-#include "base/file_util.h"
-#include "base/files/file_path.h"
-#include "base/logging.h"
-#include "base/prefs/pref_registry_simple.h"
-#include "base/prefs/pref_service.h"
-#include "base/threading/sequenced_worker_pool.h"
-#include "base/values.h"
-#include "chrome/browser/chromeos/login/login_display_host_impl.h"
-#include "chrome/browser/chromeos/login/login_utils.h"
-#include "chrome/browser/chromeos/login/managed/locally_managed_user_constants.h"
-#include "chrome/browser/chromeos/login/managed/locally_managed_user_creation_screen.h"
-#include "chrome/browser/chromeos/login/wizard_controller.h"
-#include "chrome/browser/chromeos/profiles/profile_helper.h"
-#include "chrome/browser/managed_mode/managed_user_service.h"
-#include "chrome/browser/managed_mode/managed_user_service_factory.h"
-#include "content/public/browser/browser_thread.h"
-
-using content::BrowserThread;
-
-namespace chromeos {
-
-namespace {
-
-std::string LoadSyncToken(base::FilePath profile_dir) {
- std::string token;
- base::FilePath token_file =
- profile_dir.Append(kManagedUserTokenFilename);
- LOG(INFO) << "Loading" << token_file.value();
- if (!base::ReadFileToString(token_file, &token)) {
- return std::string();
- }
- return token;
-}
-
-} // namespace
-
-LocallyManagedUserLoginFlow::LocallyManagedUserLoginFlow(
- const std::string& user_id)
- : ExtendedUserFlow(user_id),
- data_loaded_(false),
- weak_factory_(this) {
-}
-
-LocallyManagedUserLoginFlow::~LocallyManagedUserLoginFlow() {}
-
-bool LocallyManagedUserLoginFlow::ShouldLaunchBrowser() {
- return data_loaded_;
-}
-
-bool LocallyManagedUserLoginFlow::ShouldSkipPostLoginScreens() {
- return true;
-}
-
-bool LocallyManagedUserLoginFlow::HandleLoginFailure(
- const LoginFailure& failure) {
- return false;
-}
-
-bool LocallyManagedUserLoginFlow::HandlePasswordChangeDetected() {
- return false;
-}
-
-void LocallyManagedUserLoginFlow::HandleOAuthTokenStatusChange(
- User::OAuthTokenStatus status) {
-}
-
-void LocallyManagedUserLoginFlow::OnSyncSetupDataLoaded(
- const std::string& token) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- ConfigureSync(token);
-}
-
-void LocallyManagedUserLoginFlow::ConfigureSync(const std::string& token) {
- data_loaded_ = true;
- // TODO(antrim): add error handling (no token loaded).
- // See also: http://crbug.com/312751
- if (!token.empty())
- ManagedUserServiceFactory::GetForProfile(profile_)->InitSync(token);
-
- LoginUtils::Get()->DoBrowserLaunch(profile_, host());
- profile_ = NULL;
- UnregisterFlowSoon();
-}
-
-void LocallyManagedUserLoginFlow::LaunchExtraSteps(
- Profile* profile) {
- profile_ = profile;
- base::FilePath profile_dir = ProfileHelper::GetProfilePathByUserIdHash(
- UserManager::Get()->GetUserByProfile(profile)->username_hash());
- PostTaskAndReplyWithResult(
- content::BrowserThread::GetBlockingPool(),
- FROM_HERE,
- base::Bind(&LoadSyncToken, profile_dir),
- base::Bind(
- &LocallyManagedUserLoginFlow::OnSyncSetupDataLoaded,
- weak_factory_.GetWeakPtr()));
-}
-
-} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698