Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(356)

Side by Side Diff: chrome/browser/password_manager/chrome_password_manager_client.cc

Issue 733463003: Show user credentials chooser bubble. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge with trunk Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/password_manager/chrome_password_manager_client.h" 5 #include "chrome/browser/password_manager/chrome_password_manager_client.h"
6 6
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/singleton.h" 9 #include "base/memory/singleton.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 std::string uma_histogram_suffix( 176 std::string uma_histogram_suffix(
177 password_manager::metrics_util::GroupIdToString( 177 password_manager::metrics_util::GroupIdToString(
178 password_manager::metrics_util::MonitoredDomainGroupId( 178 password_manager::metrics_util::MonitoredDomainGroupId(
179 form_to_save->realm(), GetPrefs()))); 179 form_to_save->realm(), GetPrefs())));
180 SavePasswordInfoBarDelegate::Create( 180 SavePasswordInfoBarDelegate::Create(
181 web_contents(), form_to_save.Pass(), uma_histogram_suffix); 181 web_contents(), form_to_save.Pass(), uma_histogram_suffix);
182 } 182 }
183 return true; 183 return true;
184 } 184 }
185 185
186 bool ChromePasswordManagerClient::PromptUserToChooseCredentials(
187 const std::vector<autofill::PasswordForm*>& forms,
188 base::Callback<void(const password_manager::CredentialInfo&)> callback) {
189 // Take ownership of all the password form objects in the |results| vector.
190 ScopedVector<autofill::PasswordForm> entries;
191 entries.assign(forms.begin(), forms.end());
192 ManagePasswordsUIController* manage_passwords_ui_controller =
193 ManagePasswordsUIController::FromWebContents(web_contents());
194 return manage_passwords_ui_controller->OnChooseCredentials(entries.Pass(),
195 callback);
196 }
197
186 void ChromePasswordManagerClient::AutomaticPasswordSave( 198 void ChromePasswordManagerClient::AutomaticPasswordSave(
187 scoped_ptr<password_manager::PasswordFormManager> saved_form) { 199 scoped_ptr<password_manager::PasswordFormManager> saved_form) {
188 #if defined(OS_ANDROID) 200 #if defined(OS_ANDROID)
189 GeneratedPasswordSavedInfoBarDelegateAndroid::Create(web_contents()); 201 GeneratedPasswordSavedInfoBarDelegateAndroid::Create(web_contents());
190 #else 202 #else
191 if (IsTheHotNewBubbleUIEnabled()) { 203 if (IsTheHotNewBubbleUIEnabled()) {
192 ManagePasswordsUIController* manage_passwords_ui_controller = 204 ManagePasswordsUIController* manage_passwords_ui_controller =
193 ManagePasswordsUIController::FromWebContents(web_contents()); 205 ManagePasswordsUIController::FromWebContents(web_contents());
194 manage_passwords_ui_controller->OnAutomaticPasswordSave( 206 manage_passwords_ui_controller->OnAutomaticPasswordSave(
195 saved_form.Pass()); 207 saved_form.Pass());
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 530
519 if (group_name == "DisallowSyncCredentialsForReauth") { 531 if (group_name == "DisallowSyncCredentialsForReauth") {
520 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS_FOR_REAUTH; 532 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS_FOR_REAUTH;
521 } else if (group_name == "DisallowSyncCredentials") { 533 } else if (group_name == "DisallowSyncCredentials") {
522 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS; 534 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS;
523 } else { 535 } else {
524 // Allow by default. 536 // Allow by default.
525 autofill_sync_state_ = ALLOW_SYNC_CREDENTIALS; 537 autofill_sync_state_ = ALLOW_SYNC_CREDENTIALS;
526 } 538 }
527 } 539 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698