| 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 .Times(1); | 185 .Times(1); |
| 186 } | 186 } |
| 187 | 187 |
| 188 void RegisterUser(const std::string& user_id) { | 188 void RegisterUser(const std::string& user_id) { |
| 189 ListPrefUpdate users_pref(g_browser_process->local_state(), | 189 ListPrefUpdate users_pref(g_browser_process->local_state(), |
| 190 "LoggedInUsers"); | 190 "LoggedInUsers"); |
| 191 users_pref->AppendIfNotPresent(new base::StringValue(user_id)); | 191 users_pref->AppendIfNotPresent(new base::StringValue(user_id)); |
| 192 } | 192 } |
| 193 | 193 |
| 194 // ExistingUserController private member accessors. | 194 // ExistingUserController private member accessors. |
| 195 base::OneShotTimer<ExistingUserController>* auto_login_timer() { | 195 base::OneShotTimer* auto_login_timer() { |
| 196 return existing_user_controller()->auto_login_timer_.get(); | 196 return existing_user_controller()->auto_login_timer_.get(); |
| 197 } | 197 } |
| 198 | 198 |
| 199 const std::string& auto_login_username() const { | 199 const std::string& auto_login_username() const { |
| 200 return existing_user_controller()->public_session_auto_login_username_; | 200 return existing_user_controller()->public_session_auto_login_username_; |
| 201 } | 201 } |
| 202 | 202 |
| 203 int auto_login_delay() const { | 203 int auto_login_delay() const { |
| 204 return existing_user_controller()->public_session_auto_login_delay_; | 204 return existing_user_controller()->public_session_auto_login_delay_; |
| 205 } | 205 } |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 content::NotificationService::AllSources()); | 552 content::NotificationService::AllSources()); |
| 553 | 553 |
| 554 SetAutoLoginPolicy(kPublicSessionAccountId, kAutoLoginShortDelay); | 554 SetAutoLoginPolicy(kPublicSessionAccountId, kAutoLoginShortDelay); |
| 555 ASSERT_TRUE(auto_login_timer()); | 555 ASSERT_TRUE(auto_login_timer()); |
| 556 // Don't assert that timer is running: with the short delay sometimes | 556 // Don't assert that timer is running: with the short delay sometimes |
| 557 // the trigger happens before the assert. We've already tested that | 557 // the trigger happens before the assert. We've already tested that |
| 558 // the timer starts when it should. | 558 // the timer starts when it should. |
| 559 | 559 |
| 560 // Wait for the timer to fire. | 560 // Wait for the timer to fire. |
| 561 base::RunLoop runner; | 561 base::RunLoop runner; |
| 562 base::OneShotTimer<base::RunLoop> timer; | 562 base::OneShotTimer timer; |
| 563 timer.Start(FROM_HERE, | 563 timer.Start(FROM_HERE, |
| 564 base::TimeDelta::FromMilliseconds(kAutoLoginShortDelay + 1), | 564 base::TimeDelta::FromMilliseconds(kAutoLoginShortDelay + 1), |
| 565 runner.QuitClosure()); | 565 runner.QuitClosure()); |
| 566 runner.Run(); | 566 runner.Run(); |
| 567 | 567 |
| 568 profile_prepared_observer.Wait(); | 568 profile_prepared_observer.Wait(); |
| 569 | 569 |
| 570 // Wait for login tasks to complete. | 570 // Wait for login tasks to complete. |
| 571 content::RunAllPendingInMessageLoop(); | 571 content::RunAllPendingInMessageLoop(); |
| 572 } | 572 } |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 PRE_TestLoadingPublicUsersFromLocalState) { | 737 PRE_TestLoadingPublicUsersFromLocalState) { |
| 738 // First run propagates public accounts and stores them in Local State. | 738 // First run propagates public accounts and stores them in Local State. |
| 739 } | 739 } |
| 740 | 740 |
| 741 IN_PROC_BROWSER_TEST_F(ExistingUserControllerPublicSessionTest, | 741 IN_PROC_BROWSER_TEST_F(ExistingUserControllerPublicSessionTest, |
| 742 TestLoadingPublicUsersFromLocalState) { | 742 TestLoadingPublicUsersFromLocalState) { |
| 743 // Second run loads list of public accounts from Local State. | 743 // Second run loads list of public accounts from Local State. |
| 744 } | 744 } |
| 745 | 745 |
| 746 } // namespace chromeos | 746 } // namespace chromeos |
| OLD | NEW |