| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/callback.h" | 6 #include "base/callback.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/chromeos/login/users/user.h" | 10 #include "chrome/browser/chromeos/login/users/user.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // uses the ProfileHelper to obtain the userhash crbug/238623. | 179 // uses the ProfileHelper to obtain the userhash crbug/238623. |
| 180 const std::string login_user = chromeos::login::CanonicalizeUserID( | 180 const std::string login_user = chromeos::login::CanonicalizeUserID( |
| 181 command_line->GetSwitchValueNative(chromeos::switches::kLoginUser)); | 181 command_line->GetSwitchValueNative(chromeos::switches::kLoginUser)); |
| 182 const std::string sanitized_user = | 182 const std::string sanitized_user = |
| 183 CryptohomeClient::GetStubSanitizedUsername(login_user); | 183 CryptohomeClient::GetStubSanitizedUsername(login_user); |
| 184 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, | 184 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, |
| 185 sanitized_user); | 185 sanitized_user); |
| 186 } | 186 } |
| 187 | 187 |
| 188 void InitializeSanitizedUsername() { | 188 void InitializeSanitizedUsername() { |
| 189 chromeos::UserManager* user_manager = chromeos::UserManager::Get(); | 189 chromeos::UserManager* user_manager = chromeos::GetUserManager(); |
| 190 chromeos::User* user = user_manager->GetActiveUser(); | 190 chromeos::User* user = user_manager->GetActiveUser(); |
| 191 CHECK(user); | 191 CHECK(user); |
| 192 std::string userhash; | 192 std::string userhash; |
| 193 DBusThreadManager::Get()->GetCryptohomeClient()->GetSanitizedUsername( | 193 DBusThreadManager::Get()->GetCryptohomeClient()->GetSanitizedUsername( |
| 194 user->email(), | 194 user->email(), |
| 195 base::Bind(&AssignString, &userhash_)); | 195 base::Bind(&AssignString, &userhash_)); |
| 196 content::RunAllPendingInMessageLoop(); | 196 content::RunAllPendingInMessageLoop(); |
| 197 CHECK(!userhash_.empty()); | 197 CHECK(!userhash_.empty()); |
| 198 } | 198 } |
| 199 | 199 |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 | 615 |
| 616 TestListener listener( | 616 TestListener listener( |
| 617 "notifyPortalDetectorObservers", | 617 "notifyPortalDetectorObservers", |
| 618 base::Bind(&NetworkPortalDetectorTestImpl::NotifyObserversForTesting, | 618 base::Bind(&NetworkPortalDetectorTestImpl::NotifyObserversForTesting, |
| 619 base::Unretained(detector()))); | 619 base::Unretained(detector()))); |
| 620 EXPECT_TRUE(RunNetworkingSubtest("captivePortalNotification")) << message_; | 620 EXPECT_TRUE(RunNetworkingSubtest("captivePortalNotification")) << message_; |
| 621 } | 621 } |
| 622 #endif // defined(OS_CHROMEOS) | 622 #endif // defined(OS_CHROMEOS) |
| 623 | 623 |
| 624 } // namespace | 624 } // namespace |
| OLD | NEW |