| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromeos/login/managed/locally_managed_user_login_flow.
h" | 5 #include "chrome/browser/chromeos/login/managed/locally_managed_user_login_flow.
h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/prefs/pref_registry_simple.h" | 10 #include "base/prefs/pref_registry_simple.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 using content::BrowserThread; | 23 using content::BrowserThread; |
| 24 | 24 |
| 25 namespace chromeos { | 25 namespace chromeos { |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 std::string LoadSyncToken() { | 29 std::string LoadSyncToken() { |
| 30 std::string token; | 30 std::string token; |
| 31 base::FilePath token_file = | 31 base::FilePath token_file = |
| 32 file_util::GetHomeDir().Append(kManagedUserTokenFilename); | 32 file_util::GetHomeDir().Append(kManagedUserTokenFilename); |
| 33 if (!file_util::ReadFileToString(token_file, &token)) { | 33 if (!base::ReadFileToString(token_file, &token)) { |
| 34 return std::string(); | 34 return std::string(); |
| 35 } | 35 } |
| 36 return token; | 36 return token; |
| 37 } | 37 } |
| 38 | 38 |
| 39 } // namespace | 39 } // namespace |
| 40 | 40 |
| 41 LocallyManagedUserLoginFlow::LocallyManagedUserLoginFlow( | 41 LocallyManagedUserLoginFlow::LocallyManagedUserLoginFlow( |
| 42 const std::string& user_id) | 42 const std::string& user_id) |
| 43 : ExtendedUserFlow(user_id), | 43 : ExtendedUserFlow(user_id), |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 base::Bind(&LoadSyncToken), | 94 base::Bind(&LoadSyncToken), |
| 95 base::Bind( | 95 base::Bind( |
| 96 &LocallyManagedUserLoginFlow::OnSyncSetupDataLoaded, | 96 &LocallyManagedUserLoginFlow::OnSyncSetupDataLoaded, |
| 97 weak_factory_.GetWeakPtr())); | 97 weak_factory_.GetWeakPtr())); |
| 98 } else { | 98 } else { |
| 99 ConfigureSync(token); | 99 ConfigureSync(token); |
| 100 } | 100 } |
| 101 } | 101 } |
| 102 | 102 |
| 103 } // namespace chromeos | 103 } // namespace chromeos |
| OLD | NEW |