| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
| 7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
| 8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 WaitForSessionStart(); | 122 WaitForSessionStart(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 void RemoveUser(const AccountId& account_id) { | 125 void RemoveUser(const AccountId& account_id) { |
| 126 user_manager::UserManager::Get()->RemoveUser(account_id, this); | 126 user_manager::UserManager::Get()->RemoveUser(account_id, this); |
| 127 user_removal_loop_.Run(); | 127 user_removal_loop_.Run(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 private: | 130 private: |
| 131 // user_manager::RemoveUserDelegate: | 131 // user_manager::RemoveUserDelegate: |
| 132 void OnBeforeUserRemoved(const std::string& username) override {} | 132 void OnBeforeUserRemoved(const AccountId& account_id) override {} |
| 133 | 133 |
| 134 void OnUserRemoved(const std::string& username) override { | 134 void OnUserRemoved(const AccountId& account_id) override { |
| 135 user_removal_loop_.Quit(); | 135 user_removal_loop_.Quit(); |
| 136 } | 136 } |
| 137 | 137 |
| 138 base::FilePath GetRefreshTokenToDeviceIdMapFilePath() const { | 138 base::FilePath GetRefreshTokenToDeviceIdMapFilePath() const { |
| 139 return base::CommandLine::ForCurrentProcess() | 139 return base::CommandLine::ForCurrentProcess() |
| 140 ->GetSwitchValuePath(::switches::kUserDataDir) | 140 ->GetSwitchValuePath(::switches::kUserDataDir) |
| 141 .Append(kRefreshTokenToDeviceIdMapFile); | 141 .Append(kRefreshTokenToDeviceIdMapFile); |
| 142 } | 142 } |
| 143 | 143 |
| 144 void LoadRefreshTokenToDeviceIdMap() { | 144 void LoadRefreshTokenToDeviceIdMap() { |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 IN_PROC_BROWSER_TEST_F(DeviceIDTest, LegacyUsers) { | 288 IN_PROC_BROWSER_TEST_F(DeviceIDTest, LegacyUsers) { |
| 289 EXPECT_TRUE(GetDeviceId(AccountId::FromUserEmail(kFakeUserEmail)).empty()); | 289 EXPECT_TRUE(GetDeviceId(AccountId::FromUserEmail(kFakeUserEmail)).empty()); |
| 290 SignInOffline(kFakeUserEmail, kFakeUserPassword); | 290 SignInOffline(kFakeUserEmail, kFakeUserPassword); |
| 291 // Last param |auth_code| is empty, because we don't pass a device ID to GAIA | 291 // Last param |auth_code| is empty, because we don't pass a device ID to GAIA |
| 292 // in this case. | 292 // in this case. |
| 293 CheckDeviceIDIsConsistent(AccountId::FromUserEmail(kFakeUserEmail), | 293 CheckDeviceIDIsConsistent(AccountId::FromUserEmail(kFakeUserEmail), |
| 294 std::string()); | 294 std::string()); |
| 295 } | 295 } |
| 296 | 296 |
| 297 } // namespace chromeos | 297 } // namespace chromeos |
| OLD | NEW |