Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromeos/login/existing_user_controller.h" | 5 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 #include "components/signin/core/account_id/account_id.h" | 66 #include "components/signin/core/account_id/account_id.h" |
| 67 #include "components/signin/core/browser/signin_client.h" | 67 #include "components/signin/core/browser/signin_client.h" |
| 68 #include "components/user_manager/known_user.h" | 68 #include "components/user_manager/known_user.h" |
| 69 #include "components/user_manager/user_manager.h" | 69 #include "components/user_manager/user_manager.h" |
| 70 #include "components/user_manager/user_names.h" | 70 #include "components/user_manager/user_names.h" |
| 71 #include "components/user_manager/user_type.h" | 71 #include "components/user_manager/user_type.h" |
| 72 #include "components/version_info/version_info.h" | 72 #include "components/version_info/version_info.h" |
| 73 #include "content/public/browser/browser_thread.h" | 73 #include "content/public/browser/browser_thread.h" |
| 74 #include "content/public/browser/notification_service.h" | 74 #include "content/public/browser/notification_service.h" |
| 75 #include "content/public/browser/notification_types.h" | 75 #include "content/public/browser/notification_types.h" |
| 76 #include "content/public/browser/storage_partition.h" | |
| 76 #include "content/public/browser/user_metrics.h" | 77 #include "content/public/browser/user_metrics.h" |
| 77 #include "google_apis/gaia/gaia_auth_util.h" | 78 #include "google_apis/gaia/gaia_auth_util.h" |
| 78 #include "google_apis/gaia/google_service_auth_error.h" | 79 #include "google_apis/gaia/google_service_auth_error.h" |
| 79 #include "net/http/http_auth_cache.h" | 80 #include "net/http/http_auth_cache.h" |
| 80 #include "net/http/http_network_session.h" | 81 #include "net/http/http_network_session.h" |
| 81 #include "net/http/http_transaction_factory.h" | 82 #include "net/http/http_transaction_factory.h" |
| 82 #include "net/url_request/url_request_context.h" | 83 #include "net/url_request/url_request_context.h" |
| 83 #include "net/url_request/url_request_context_getter.h" | 84 #include "net/url_request/url_request_context_getter.h" |
| 84 #include "ui/accessibility/ax_enums.h" | 85 #include "ui/accessibility/ax_enums.h" |
| 85 #include "ui/base/l10n/l10n_util.h" | 86 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 109 const long int kSafeModeRestartUiDelayMs = 30000; | 110 const long int kSafeModeRestartUiDelayMs = 30000; |
| 110 | 111 |
| 111 // Makes a call to the policy subsystem to reload the policy when we detect | 112 // Makes a call to the policy subsystem to reload the policy when we detect |
| 112 // authentication change. | 113 // authentication change. |
| 113 void RefreshPoliciesOnUIThread() { | 114 void RefreshPoliciesOnUIThread() { |
| 114 if (g_browser_process->policy_service()) | 115 if (g_browser_process->policy_service()) |
| 115 g_browser_process->policy_service()->RefreshPolicies(base::Closure()); | 116 g_browser_process->policy_service()->RefreshPolicies(base::Closure()); |
| 116 } | 117 } |
| 117 | 118 |
| 118 // Copies any authentication details that were entered in the login profile in | 119 // Copies any authentication details that were entered in the login profile in |
| 119 // the mail profile to make sure all subsystems of Chrome can access the network | 120 // the mail profile to make sure all subsystems of Chrome can access the network |
|
xiyuan
2017/01/18 23:34:08
Could you help to update the comment since you are
xiaoyinh(OOO Sep 11-29)
2017/01/19 01:32:08
Done.
| |
| 120 // with the provided authentication which are possibly for a proxy server. | 121 // with the provided authentication which are possibly for a proxy server. |
| 121 void TransferContextAuthenticationsOnIOThread( | 122 void TransferContextAuthenticationsOnIOThread( |
| 122 net::URLRequestContextGetter* default_profile_context_getter, | 123 net::URLRequestContextGetter* default_profile_context_getter, |
| 123 net::URLRequestContextGetter* browser_process_context_getter) { | 124 net::URLRequestContextGetter* browser_process_context_getter) { |
| 124 net::HttpAuthCache* new_cache = | 125 net::HttpAuthCache* new_cache = |
| 125 browser_process_context_getter->GetURLRequestContext()-> | 126 browser_process_context_getter->GetURLRequestContext()-> |
| 126 http_transaction_factory()->GetSession()->http_auth_cache(); | 127 http_transaction_factory()->GetSession()->http_auth_cache(); |
| 127 net::HttpAuthCache* old_cache = | 128 net::HttpAuthCache* old_cache = |
| 128 default_profile_context_getter->GetURLRequestContext()-> | 129 default_profile_context_getter->GetURLRequestContext()-> |
| 129 http_transaction_factory()->GetSession()->http_auth_cache(); | 130 http_transaction_factory()->GetSession()->http_auth_cache(); |
| 130 new_cache->UpdateAllFrom(*old_cache); | 131 new_cache->UpdateAllFrom(*old_cache); |
| 132 | |
| 133 // Copy the auth cache from webview's context since the proxy authentication | |
| 134 // information is saved in webview's context. | |
| 135 content::StoragePartition* signin_partition = login::GetSigninPartition(); | |
|
nharper
2017/01/19 00:42:17
Is there a reason for doing this here instead of r
xiaoyinh(OOO Sep 11-29)
2017/01/19 01:32:08
Thanks for the review. I just tried the normal log
xiyuan
2017/01/19 17:20:26
The Gaia is now served in webview and GetSigninPar
| |
| 136 if (signin_partition) { | |
| 137 net::URLRequestContextGetter* webview_context = | |
| 138 signin_partition->GetURLRequestContext(); | |
| 139 net::HttpAuthCache* webview_cache = webview_context->GetURLRequestContext() | |
| 140 ->http_transaction_factory() | |
| 141 ->GetSession() | |
| 142 ->http_auth_cache(); | |
| 143 new_cache->UpdateAllFrom(*webview_cache); | |
| 144 } | |
| 145 | |
| 131 VLOG(1) << "Main request context populated with authentication data."; | 146 VLOG(1) << "Main request context populated with authentication data."; |
| 132 // Last but not least tell the policy subsystem to refresh now as it might | 147 // Last but not least tell the policy subsystem to refresh now as it might |
| 133 // have been stuck until now too. | 148 // have been stuck until now too. |
| 134 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, | 149 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, |
| 135 base::Bind(&RefreshPoliciesOnUIThread)); | 150 base::Bind(&RefreshPoliciesOnUIThread)); |
| 136 } | 151 } |
| 137 | 152 |
| 138 // Record UMA for password login of regular user when Easy sign-in is enabled. | 153 // Record UMA for password login of regular user when Easy sign-in is enabled. |
| 139 void RecordPasswordLoginEvent(const UserContext& user_context) { | 154 void RecordPasswordLoginEvent(const UserContext& user_context) { |
| 140 EasyUnlockService* easy_unlock_service = | 155 EasyUnlockService* easy_unlock_service = |
| (...skipping 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1320 } | 1335 } |
| 1321 | 1336 |
| 1322 // Otherwise, show the unrecoverable cryptohome error UI and ask user's | 1337 // Otherwise, show the unrecoverable cryptohome error UI and ask user's |
| 1323 // permission to collect a feedback. | 1338 // permission to collect a feedback. |
| 1324 RecordPasswordChangeFlow(LOGIN_PASSWORD_CHANGE_FLOW_CRYPTOHOME_FAILURE); | 1339 RecordPasswordChangeFlow(LOGIN_PASSWORD_CHANGE_FLOW_CRYPTOHOME_FAILURE); |
| 1325 VLOG(1) << "Show unrecoverable cryptohome error dialog."; | 1340 VLOG(1) << "Show unrecoverable cryptohome error dialog."; |
| 1326 login_display_->ShowUnrecoverableCrypthomeErrorDialog(); | 1341 login_display_->ShowUnrecoverableCrypthomeErrorDialog(); |
| 1327 } | 1342 } |
| 1328 | 1343 |
| 1329 } // namespace chromeos | 1344 } // namespace chromeos |
| OLD | NEW |