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/ui/login/login_handler.h" | 5 #include "chrome/browser/ui/login/login_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 password_manager::PasswordManager* LoginHandler::GetPasswordManagerForLogin() { | 231 password_manager::PasswordManager* LoginHandler::GetPasswordManagerForLogin() { |
232 password_manager::PasswordManagerClient* client = | 232 password_manager::PasswordManagerClient* client = |
233 ChromePasswordManagerClient::FromWebContents(GetWebContentsForLogin()); | 233 ChromePasswordManagerClient::FromWebContents(GetWebContentsForLogin()); |
234 return client ? client->GetPasswordManager() : nullptr; | 234 return client ? client->GetPasswordManager() : nullptr; |
235 } | 235 } |
236 | 236 |
237 void LoginHandler::SetAuth(const base::string16& username, | 237 void LoginHandler::SetAuth(const base::string16& username, |
238 const base::string16& password) { | 238 const base::string16& password) { |
239 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 239 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
240 | 240 |
241 scoped_ptr<password_manager::BrowserSavePasswordProgressLogger> logger; | 241 std::unique_ptr<password_manager::BrowserSavePasswordProgressLogger> logger; |
242 if (password_manager_ && | 242 if (password_manager_ && |
243 password_manager_->client()->GetLogManager()->IsLoggingActive()) { | 243 password_manager_->client()->GetLogManager()->IsLoggingActive()) { |
244 logger.reset(new password_manager::BrowserSavePasswordProgressLogger( | 244 logger.reset(new password_manager::BrowserSavePasswordProgressLogger( |
245 password_manager_->client()->GetLogManager())); | 245 password_manager_->client()->GetLogManager())); |
246 logger->LogMessage( | 246 logger->LogMessage( |
247 autofill::SavePasswordProgressLogger::STRING_SET_AUTH_METHOD); | 247 autofill::SavePasswordProgressLogger::STRING_SET_AUTH_METHOD); |
248 } | 248 } |
249 | 249 |
250 bool already_handled = TestAndSetAuthHandled(); | 250 bool already_handled = TestAndSetAuthHandled(); |
251 if (logger) { | 251 if (logger) { |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 signon_realm = auth_info.challenger.ToString(); | 597 signon_realm = auth_info.challenger.ToString(); |
598 signon_realm.append("/"); | 598 signon_realm.append("/"); |
599 } else { | 599 } else { |
600 // Take scheme, host, and port from the url. | 600 // Take scheme, host, and port from the url. |
601 signon_realm = url.GetOrigin().spec(); | 601 signon_realm = url.GetOrigin().spec(); |
602 // This ends with a "/". | 602 // This ends with a "/". |
603 } | 603 } |
604 signon_realm.append(auth_info.realm); | 604 signon_realm.append(auth_info.realm); |
605 return signon_realm; | 605 return signon_realm; |
606 } | 606 } |
OLD | NEW |