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/user_manager_screen_handler.h" | 5 #include "chrome/browser/ui/webui/signin/user_manager_screen_handler.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
462 GetURLRequestContext())); | 462 GetURLRequestContext())); |
463 } | 463 } |
464 | 464 |
465 const std::string token = entry->GetPasswordChangeDetectionToken(); | 465 const std::string token = entry->GetPasswordChangeDetectionToken(); |
466 if (!token.empty()) { | 466 if (!token.empty()) { |
467 oauth_client_->GetTokenHandleInfo(token, kMaxOAuthRetries, this); | 467 oauth_client_->GetTokenHandleInfo(token, kMaxOAuthRetries, this); |
468 return; | 468 return; |
469 } | 469 } |
470 } | 470 } |
471 | 471 |
472 // In order to support the upgrade case where we have a local hash but no | 472 content::BrowserContext* browser_context = |
473 // password token, the user perform a full online reauth. | 473 web_ui()->GetWebContents()->GetBrowserContext(); |
474 UserManager::ShowReauthDialog(web_ui()->GetWebContents()->GetBrowserContext(), | 474 |
475 email_address_, | 475 // In order to support the upgrade case where we have a local hash but no |
476 // password token, the user perform a full online reauth. | |
477 // TODO(zmin): Remove the condition for MACOSX once user_manager_mac.cc is | |
478 // updated. | |
479 #if !defined(OS_MACOSX) | |
480 if (!email_address_.empty()) { | |
481 UserManager::ShowReauthDialog(browser_context, email_address_, | |
482 signin_metrics::Reason::REASON_UNLOCK); | |
483 } else { | |
484 // Fresh sign in via user manager without existed email address. | |
anthonyvd
2016/09/22 18:38:46
nit: existed -> existing
zmin
2016/09/22 19:14:56
Done.
| |
485 UserManager::ShowSigninDialog(browser_context, profile_path); | |
486 } | |
487 #else | |
488 UserManager::ShowReauthDialog(browser_context, email_address_, | |
476 signin_metrics::Reason::REASON_UNLOCK); | 489 signin_metrics::Reason::REASON_UNLOCK); |
490 #endif | |
477 } | 491 } |
Roger Tawa OOO till Jul 10th
2016/09/22 18:59:13
Don't you need to check the "force" flag in ::Hand
zmin
2016/09/22 19:14:56
Yes, this CL is focusing on the error dialog. I ch
| |
478 | 492 |
479 void UserManagerScreenHandler::HandleRemoveUser(const base::ListValue* args) { | 493 void UserManagerScreenHandler::HandleRemoveUser(const base::ListValue* args) { |
480 DCHECK(args); | 494 DCHECK(args); |
481 const base::Value* profile_path_value; | 495 const base::Value* profile_path_value; |
482 if (!args->Get(0, &profile_path_value)) { | 496 if (!args->Get(0, &profile_path_value)) { |
483 NOTREACHED(); | 497 NOTREACHED(); |
484 return; | 498 return; |
485 } | 499 } |
486 | 500 |
487 base::FilePath profile_path; | 501 base::FilePath profile_path; |
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1039 Profile* profile, Profile::CreateStatus profile_create_status) { | 1053 Profile* profile, Profile::CreateStatus profile_create_status) { |
1040 Browser* browser = chrome::FindAnyBrowser(profile, false); | 1054 Browser* browser = chrome::FindAnyBrowser(profile, false); |
1041 if (browser && browser->window()) { | 1055 if (browser && browser->window()) { |
1042 OnBrowserWindowReady(browser); | 1056 OnBrowserWindowReady(browser); |
1043 } else { | 1057 } else { |
1044 registrar_.Add(this, | 1058 registrar_.Add(this, |
1045 chrome::NOTIFICATION_BROWSER_WINDOW_READY, | 1059 chrome::NOTIFICATION_BROWSER_WINDOW_READY, |
1046 content::NotificationService::AllSources()); | 1060 content::NotificationService::AllSources()); |
1047 } | 1061 } |
1048 } | 1062 } |
OLD | NEW |