| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/chromeos/chrome_browser_main_chromeos.h" | 5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 // The instance will be deleted upon success or failure. | 138 // The instance will be deleted upon success or failure. |
| 139 class StubLogin : public LoginStatusConsumer, | 139 class StubLogin : public LoginStatusConsumer, |
| 140 public LoginUtils::Delegate { | 140 public LoginUtils::Delegate { |
| 141 public: | 141 public: |
| 142 StubLogin(std::string username, std::string password) | 142 StubLogin(std::string username, std::string password) |
| 143 : pending_requests_(false), | 143 : pending_requests_(false), |
| 144 profile_prepared_(false) { | 144 profile_prepared_(false) { |
| 145 authenticator_ = LoginUtils::Get()->CreateAuthenticator(this); | 145 authenticator_ = LoginUtils::Get()->CreateAuthenticator(this); |
| 146 authenticator_.get()->AuthenticateToLogin( | 146 authenticator_.get()->AuthenticateToLogin( |
| 147 g_browser_process->profile_manager()->GetDefaultProfile(), | 147 g_browser_process->profile_manager()->GetDefaultProfile(), |
| 148 username, | 148 UserCredentials(username, |
| 149 password, | 149 password, |
| 150 std::string(), | 150 std::string()), // auth_code |
| 151 std::string()); | 151 std::string(), // login_token |
| 152 std::string()); // login_captcha |
| 152 } | 153 } |
| 153 | 154 |
| 154 virtual ~StubLogin() { | 155 virtual ~StubLogin() { |
| 155 LoginUtils::Get()->DelegateDeleted(this); | 156 LoginUtils::Get()->DelegateDeleted(this); |
| 156 } | 157 } |
| 157 | 158 |
| 158 virtual void OnLoginFailure(const LoginFailure& error) OVERRIDE { | 159 virtual void OnLoginFailure(const LoginFailure& error) OVERRIDE { |
| 159 LOG(ERROR) << "Login Failure: " << error.GetErrorString(); | 160 LOG(ERROR) << "Login Failure: " << error.GetErrorString(); |
| 160 delete this; | 161 delete this; |
| 161 } | 162 } |
| 162 | 163 |
| 163 virtual void OnLoginSuccess(const std::string& username, | 164 virtual void OnLoginSuccess(const UserCredentials& credentials, |
| 164 const std::string& password, | |
| 165 bool pending_requests, | 165 bool pending_requests, |
| 166 bool using_oauth) OVERRIDE { | 166 bool using_oauth) OVERRIDE { |
| 167 pending_requests_ = pending_requests; | 167 pending_requests_ = pending_requests; |
| 168 if (!profile_prepared_) { | 168 if (!profile_prepared_) { |
| 169 // Will call OnProfilePrepared in the end. | 169 // Will call OnProfilePrepared in the end. |
| 170 LoginUtils::Get()->PrepareProfile(username, | 170 LoginUtils::Get()->PrepareProfile(credentials, |
| 171 std::string(), | 171 std::string(), // display_email |
| 172 password, | |
| 173 using_oauth, | 172 using_oauth, |
| 174 false, | 173 false, // has_cookies |
| 175 this); | 174 this); |
| 176 } else if (!pending_requests) { | 175 } else if (!pending_requests) { |
| 177 delete this; | 176 delete this; |
| 178 } | 177 } |
| 179 } | 178 } |
| 180 | 179 |
| 181 // LoginUtils::Delegate implementation: | 180 // LoginUtils::Delegate implementation: |
| 182 virtual void OnProfilePrepared(Profile* profile) OVERRIDE { | 181 virtual void OnProfilePrepared(Profile* profile) OVERRIDE { |
| 183 profile_prepared_ = true; | 182 profile_prepared_ = true; |
| 184 LoginUtils::Get()->DoBrowserLaunch(profile, NULL); | 183 LoginUtils::Get()->DoBrowserLaunch(profile, NULL); |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 853 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); | 852 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); |
| 854 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); | 853 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); |
| 855 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); | 854 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); |
| 856 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); | 855 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); |
| 857 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); | 856 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); |
| 858 // This is necessary to start the experiment as a side effect. | 857 // This is necessary to start the experiment as a side effect. |
| 859 trial->group(); | 858 trial->group(); |
| 860 } | 859 } |
| 861 | 860 |
| 862 } // namespace chromeos | 861 } // namespace chromeos |
| OLD | NEW |