Chromium Code Reviews| 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.h" | 5 #include "chrome/browser/ui/webui/signin/inline_login_handler.h" |
| 6 | 6 |
| 7 #include <limits.h> | 7 #include <limits.h> |
| 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 191 GaiaUrls* gaiaUrls = GaiaUrls::GetInstance(); | 191 GaiaUrls* gaiaUrls = GaiaUrls::GetInstance(); |
| 192 params.SetString("gaiaUrl", gaiaUrls->gaia_url().spec()); | 192 params.SetString("gaiaUrl", gaiaUrls->gaia_url().spec()); |
| 193 params.SetInteger("authMode", InlineLoginHandler::kDesktopAuthMode); | 193 params.SetInteger("authMode", InlineLoginHandler::kDesktopAuthMode); |
| 194 | 194 |
| 195 const GURL& current_url = web_ui()->GetWebContents()->GetURL(); | 195 const GURL& current_url = web_ui()->GetWebContents()->GetURL(); |
| 196 signin_metrics::AccessPoint access_point = | 196 signin_metrics::AccessPoint access_point = |
| 197 signin::GetAccessPointForPromoURL(current_url); | 197 signin::GetAccessPointForPromoURL(current_url); |
| 198 signin_metrics::Reason reason = | 198 signin_metrics::Reason reason = |
| 199 signin::GetSigninReasonForPromoURL(current_url); | 199 signin::GetSigninReasonForPromoURL(current_url); |
| 200 | 200 |
| 201 if (reason != signin_metrics::Reason::REASON_REAUTHENTICATION || | 201 if (reason != signin_metrics::Reason::REASON_REAUTHENTICATION && |
| 202 reason != signin_metrics::Reason::REASON_UNLOCK || | 202 reason != signin_metrics::Reason::REASON_UNLOCK && |
| 203 reason != signin_metrics::Reason::REASON_ADD_SECONDARY_ACCOUNT) { | 203 reason != signin_metrics::Reason::REASON_ADD_SECONDARY_ACCOUNT) { |
|
Roger Tawa OOO till Jul 10th
2016/10/12 15:16:45
Instead of checking for not reauth|unlock|add-seco
gogerald1
2016/10/12 15:21:30
I think we might have to record it since if the re
| |
| 204 signin_metrics::LogSigninAccessPointStarted(access_point); | 204 signin_metrics::LogSigninAccessPointStarted(access_point); |
| 205 RecordSigninUserActionForAccessPoint(access_point); | |
| 206 content::RecordAction(base::UserMetricsAction("Signin_SigninPage_Loading")); | |
| 207 params.SetBoolean("isLoginPrimaryAccount", true); | |
| 205 } | 208 } |
| 206 RecordSigninUserActionForAccessPoint(access_point); | |
| 207 content::RecordAction(base::UserMetricsAction("Signin_SigninPage_Loading")); | |
| 208 | 209 |
| 209 params.SetString("continueUrl", signin::GetLandingURL(access_point).spec()); | 210 params.SetString("continueUrl", signin::GetLandingURL(access_point).spec()); |
| 210 | 211 |
| 211 Profile* profile = Profile::FromWebUI(web_ui()); | 212 Profile* profile = Profile::FromWebUI(web_ui()); |
| 212 std::string default_email; | 213 std::string default_email; |
| 213 if (reason == signin_metrics::Reason::REASON_SIGNIN_PRIMARY_ACCOUNT) { | 214 if (reason == signin_metrics::Reason::REASON_SIGNIN_PRIMARY_ACCOUNT) { |
| 214 default_email = | 215 default_email = |
| 215 profile->GetPrefs()->GetString(prefs::kGoogleServicesLastUsername); | 216 profile->GetPrefs()->GetString(prefs::kGoogleServicesLastUsername); |
| 216 } else { | 217 } else { |
| 217 if (!net::GetValueForKeyInQuery(current_url, "email", &default_email)) | 218 if (!net::GetValueForKeyInQuery(current_url, "email", &default_email)) |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 279 | 280 |
| 280 void InlineLoginHandler::HandleDialogClose(const base::ListValue* args) { | 281 void InlineLoginHandler::HandleDialogClose(const base::ListValue* args) { |
| 281 Browser* browser = signin::GetDesktopBrowser(web_ui()); | 282 Browser* browser = signin::GetDesktopBrowser(web_ui()); |
| 282 // If the dialog was opened in the User Manager browser will be null here. | 283 // If the dialog was opened in the User Manager browser will be null here. |
| 283 if (browser) | 284 if (browser) |
| 284 browser->CloseModalSigninWindow(); | 285 browser->CloseModalSigninWindow(); |
| 285 | 286 |
| 286 // Does nothing if user manager is not showing. | 287 // Does nothing if user manager is not showing. |
| 287 UserManager::HideReauthDialog(); | 288 UserManager::HideReauthDialog(); |
| 288 } | 289 } |
| OLD | NEW |