| 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 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "chrome/browser/ui/user_manager.h" | 42 #include "chrome/browser/ui/user_manager.h" |
| 43 #include "chrome/browser/ui/webui/profile_helper.h" | 43 #include "chrome/browser/ui/webui/profile_helper.h" |
| 44 #include "chrome/common/pref_names.h" | 44 #include "chrome/common/pref_names.h" |
| 45 #include "chrome/common/url_constants.h" | 45 #include "chrome/common/url_constants.h" |
| 46 #include "chrome/grit/chromium_strings.h" | 46 #include "chrome/grit/chromium_strings.h" |
| 47 #include "chrome/grit/generated_resources.h" | 47 #include "chrome/grit/generated_resources.h" |
| 48 #include "components/prefs/pref_service.h" | 48 #include "components/prefs/pref_service.h" |
| 49 #include "components/proximity_auth/screenlock_bridge.h" | 49 #include "components/proximity_auth/screenlock_bridge.h" |
| 50 #include "components/signin/core/account_id/account_id.h" | 50 #include "components/signin/core/account_id/account_id.h" |
| 51 #include "content/public/browser/notification_service.h" | 51 #include "content/public/browser/notification_service.h" |
| 52 #include "content/public/browser/storage_partition.h" | |
| 53 #include "content/public/browser/web_contents.h" | 52 #include "content/public/browser/web_contents.h" |
| 54 #include "content/public/browser/web_ui.h" | 53 #include "content/public/browser/web_ui.h" |
| 55 #include "google_apis/gaia/gaia_auth_fetcher.h" | 54 #include "google_apis/gaia/gaia_auth_fetcher.h" |
| 56 #include "google_apis/gaia/gaia_constants.h" | 55 #include "google_apis/gaia/gaia_constants.h" |
| 57 #include "grit/components_strings.h" | 56 #include "grit/components_strings.h" |
| 58 #include "third_party/skia/include/core/SkBitmap.h" | 57 #include "third_party/skia/include/core/SkBitmap.h" |
| 59 #include "ui/base/l10n/l10n_util.h" | 58 #include "ui/base/l10n/l10n_util.h" |
| 60 #include "ui/base/resource/resource_bundle.h" | 59 #include "ui/base/resource/resource_bundle.h" |
| 61 #include "ui/base/webui/web_ui_util.h" | 60 #include "ui/base/webui/web_ui_util.h" |
| 62 #include "ui/gfx/image/image.h" | 61 #include "ui/gfx/image/image.h" |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 if (LocalAuth::ValidateLocalAuthCredentials(entry, password)) { | 423 if (LocalAuth::ValidateLocalAuthCredentials(entry, password)) { |
| 425 ReportAuthenticationResult(true, ProfileMetrics::AUTH_LOCAL); | 424 ReportAuthenticationResult(true, ProfileMetrics::AUTH_LOCAL); |
| 426 return; | 425 return; |
| 427 } | 426 } |
| 428 | 427 |
| 429 // This could be a mis-typed password or typing a new password while we | 428 // This could be a mis-typed password or typing a new password while we |
| 430 // still have a hash of the old one. The new way of checking a password | 429 // still have a hash of the old one. The new way of checking a password |
| 431 // change makes use of a token so we do that... if it's available. | 430 // change makes use of a token so we do that... if it's available. |
| 432 if (!oauth_client_) { | 431 if (!oauth_client_) { |
| 433 oauth_client_.reset(new gaia::GaiaOAuthClient( | 432 oauth_client_.reset(new gaia::GaiaOAuthClient( |
| 434 content::BrowserContext::GetDefaultStoragePartition( | 433 web_ui()->GetWebContents()->GetBrowserContext() |
| 435 web_ui()->GetWebContents()->GetBrowserContext())-> | 434 ->GetRequestContext())); |
| 436 GetURLRequestContext())); | |
| 437 } | 435 } |
| 438 | 436 |
| 439 const std::string token = entry->GetPasswordChangeDetectionToken(); | 437 const std::string token = entry->GetPasswordChangeDetectionToken(); |
| 440 if (!token.empty()) { | 438 if (!token.empty()) { |
| 441 oauth_client_->GetTokenHandleInfo(token, kMaxOAuthRetries, this); | 439 oauth_client_->GetTokenHandleInfo(token, kMaxOAuthRetries, this); |
| 442 return; | 440 return; |
| 443 } | 441 } |
| 444 } | 442 } |
| 445 | 443 |
| 446 // In order to support the upgrade case where we have a local hash but no | 444 // In order to support the upgrade case where we have a local hash but no |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 981 Profile* profile, Profile::CreateStatus profile_create_status) { | 979 Profile* profile, Profile::CreateStatus profile_create_status) { |
| 982 Browser* browser = chrome::FindAnyBrowser(profile, false); | 980 Browser* browser = chrome::FindAnyBrowser(profile, false); |
| 983 if (browser && browser->window()) { | 981 if (browser && browser->window()) { |
| 984 OnBrowserWindowReady(browser); | 982 OnBrowserWindowReady(browser); |
| 985 } else { | 983 } else { |
| 986 registrar_.Add(this, | 984 registrar_.Add(this, |
| 987 chrome::NOTIFICATION_BROWSER_WINDOW_READY, | 985 chrome::NOTIFICATION_BROWSER_WINDOW_READY, |
| 988 content::NotificationService::AllSources()); | 986 content::NotificationService::AllSources()); |
| 989 } | 987 } |
| 990 } | 988 } |
| OLD | NEW |