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