| 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 "chrome/browser/ui/webui/signin/inline_login_handler_impl.h" | 5 #include "chrome/browser/ui/webui/signin/inline_login_handler_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 | 133 |
| 134 signin_metrics::Source source = signin::GetSourceForPromoURL(current_url_); | 134 signin_metrics::Source source = signin::GetSourceForPromoURL(current_url_); |
| 135 | 135 |
| 136 std::string primary_email = | 136 std::string primary_email = |
| 137 SigninManagerFactory::GetForProfile(profile_)->GetAuthenticatedUsername(); | 137 SigninManagerFactory::GetForProfile(profile_)->GetAuthenticatedUsername(); |
| 138 if (gaia::AreEmailsSame(email_, primary_email) && | 138 if (gaia::AreEmailsSame(email_, primary_email) && |
| 139 source == signin_metrics::SOURCE_REAUTH && | 139 source == signin_metrics::SOURCE_REAUTH && |
| 140 switches::IsNewProfileManagement() && | 140 switches::IsNewProfileManagement() && |
| 141 !password_.empty() && | 141 !password_.empty() && |
| 142 profiles::IsLockAvailable(profile_)) { | 142 profiles::IsLockAvailable(profile_)) { |
| 143 chrome::SetLocalAuthCredentials(profile_, password_); | 143 LocalAuth::SetLocalAuthCredentials(profile_, password_); |
| 144 } | 144 } |
| 145 | 145 |
| 146 if (source == signin_metrics::SOURCE_AVATAR_BUBBLE_ADD_ACCOUNT || | 146 if (source == signin_metrics::SOURCE_AVATAR_BUBBLE_ADD_ACCOUNT || |
| 147 source == signin_metrics::SOURCE_REAUTH) { | 147 source == signin_metrics::SOURCE_REAUTH) { |
| 148 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_)-> | 148 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_)-> |
| 149 UpdateCredentials(account_id, result.refresh_token); | 149 UpdateCredentials(account_id, result.refresh_token); |
| 150 | 150 |
| 151 if (signin::IsAutoCloseEnabledInURL(current_url_)) { | 151 if (signin::IsAutoCloseEnabledInURL(current_url_)) { |
| 152 // Close the gaia sign in tab via a task to make sure we aren't in the | 152 // Close the gaia sign in tab via a task to make sure we aren't in the |
| 153 // middle of any webui handler code. | 153 // middle of any webui handler code. |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 } | 457 } |
| 458 } | 458 } |
| 459 | 459 |
| 460 if (show_account_management) { | 460 if (show_account_management) { |
| 461 browser->window()->ShowAvatarBubbleFromAvatarButton( | 461 browser->window()->ShowAvatarBubbleFromAvatarButton( |
| 462 BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT, | 462 BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT, |
| 463 signin::ManageAccountsParams()); | 463 signin::ManageAccountsParams()); |
| 464 } | 464 } |
| 465 } | 465 } |
| 466 } | 466 } |
| OLD | NEW |