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 #if !defined(OS_MACOSX) |
tommycli
2016/09/21 18:26:59
Why the mac vs. non-mac distinction?
Also the non
zmin
2016/09/21 21:21:37
Because the user_manager implementation on Mac is
tommycli
2016/09/21 21:26:16
Okay that's fine, please add a TODO for yourself e
zmin
2016/09/21 21:52:05
Done.
| |
476 if (!email_address_.empty()) { | |
477 // In order to support the upgrade case where we have a local hash but no | |
478 // password token, the user perform a full online reauth. | |
479 UserManager::ShowReauthDialog(browser_context, email_address_, | |
480 signin_metrics::Reason::REASON_UNLOCK); | |
481 } else { | |
482 // Fresh sign in via user manager without existed email address. | |
483 UserManager::ShowSigninDialog(browser_context, profile_path); | |
484 } | |
485 } | |
486 #else | |
487 UserManager::ShowReauthDialog(browser_context, email_address_, | |
476 signin_metrics::Reason::REASON_UNLOCK); | 488 signin_metrics::Reason::REASON_UNLOCK); |
477 } | 489 #endif |
478 | 490 |
479 void UserManagerScreenHandler::HandleRemoveUser(const base::ListValue* args) { | 491 void UserManagerScreenHandler::HandleRemoveUser(const base::ListValue* args) { |
480 DCHECK(args); | 492 DCHECK(args); |
481 const base::Value* profile_path_value; | 493 const base::Value* profile_path_value; |
482 if (!args->Get(0, &profile_path_value)) { | 494 if (!args->Get(0, &profile_path_value)) { |
483 NOTREACHED(); | 495 NOTREACHED(); |
484 return; | 496 return; |
485 } | 497 } |
486 | 498 |
487 base::FilePath profile_path; | 499 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) { | 1051 Profile* profile, Profile::CreateStatus profile_create_status) { |
1040 Browser* browser = chrome::FindAnyBrowser(profile, false); | 1052 Browser* browser = chrome::FindAnyBrowser(profile, false); |
1041 if (browser && browser->window()) { | 1053 if (browser && browser->window()) { |
1042 OnBrowserWindowReady(browser); | 1054 OnBrowserWindowReady(browser); |
1043 } else { | 1055 } else { |
1044 registrar_.Add(this, | 1056 registrar_.Add(this, |
1045 chrome::NOTIFICATION_BROWSER_WINDOW_READY, | 1057 chrome::NOTIFICATION_BROWSER_WINDOW_READY, |
1046 content::NotificationService::AllSources()); | 1058 content::NotificationService::AllSources()); |
1047 } | 1059 } |
1048 } | 1060 } |
OLD | NEW |