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

Side by Side Diff: chrome/browser/ui/passwords/manage_passwords_ui_controller.cc

Issue 1832933002: Update the |skip_zero_click| flag of a credential when selected in the account chooser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 4 years, 8 months 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/ui/passwords/manage_passwords_ui_controller.h" 5 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "chrome/app/chrome_command_ids.h" 10 #include "chrome/app/chrome_command_ids.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 DestroyAccountChooser(); 92 DestroyAccountChooser();
93 passwords_data_.OnUpdatePassword(std::move(form_manager)); 93 passwords_data_.OnUpdatePassword(std::move(form_manager));
94 bubble_status_ = SHOULD_POP_UP; 94 bubble_status_ = SHOULD_POP_UP;
95 UpdateBubbleAndIconVisibility(); 95 UpdateBubbleAndIconVisibility();
96 } 96 }
97 97
98 bool ManagePasswordsUIController::OnChooseCredentials( 98 bool ManagePasswordsUIController::OnChooseCredentials(
99 ScopedVector<autofill::PasswordForm> local_credentials, 99 ScopedVector<autofill::PasswordForm> local_credentials,
100 ScopedVector<autofill::PasswordForm> federated_credentials, 100 ScopedVector<autofill::PasswordForm> federated_credentials,
101 const GURL& origin, 101 const GURL& origin,
102 base::Callback<void(const password_manager::CredentialInfo&)> callback) { 102 const ManagePasswordsState::CredentialsCallback& callback) {
103 DCHECK(!local_credentials.empty() || !federated_credentials.empty()); 103 DCHECK(!local_credentials.empty() || !federated_credentials.empty());
104 PasswordDialogController::FormsVector locals = 104 PasswordDialogController::FormsVector locals =
105 CopyFormVector(local_credentials); 105 CopyFormVector(local_credentials);
106 PasswordDialogController::FormsVector federations = 106 PasswordDialogController::FormsVector federations =
107 CopyFormVector(federated_credentials); 107 CopyFormVector(federated_credentials);
108 passwords_data_.OnRequestCredentials( 108 passwords_data_.OnRequestCredentials(
109 std::move(local_credentials), std::move(federated_credentials), origin); 109 std::move(local_credentials), std::move(federated_credentials), origin);
110 passwords_data_.set_credentials_callback(callback); 110 passwords_data_.set_credentials_callback(callback);
111 dialog_controller_.reset(new PasswordDialogControllerImpl( 111 dialog_controller_.reset(new PasswordDialogControllerImpl(
112 Profile::FromBrowserContext(web_contents()->GetBrowserContext()), 112 Profile::FromBrowserContext(web_contents()->GetBrowserContext()),
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 DCHECK_EQ(password_manager::ui::PENDING_PASSWORD_UPDATE_STATE, GetState()); 288 DCHECK_EQ(password_manager::ui::PENDING_PASSWORD_UPDATE_STATE, GetState());
289 UpdatePasswordInternal(password_form); 289 UpdatePasswordInternal(password_form);
290 passwords_data_.TransitionToState(password_manager::ui::MANAGE_STATE); 290 passwords_data_.TransitionToState(password_manager::ui::MANAGE_STATE);
291 UpdateBubbleAndIconVisibility(); 291 UpdateBubbleAndIconVisibility();
292 } 292 }
293 293
294 void ManagePasswordsUIController::ChooseCredential( 294 void ManagePasswordsUIController::ChooseCredential(
295 autofill::PasswordForm form, 295 autofill::PasswordForm form,
296 password_manager::CredentialType credential_type) { 296 password_manager::CredentialType credential_type) {
297 DCHECK(dialog_controller_); 297 DCHECK(dialog_controller_);
298 DCHECK_EQ(password_manager::CredentialType::CREDENTIAL_TYPE_PASSWORD,
299 credential_type);
298 dialog_controller_.reset(); 300 dialog_controller_.reset();
299 passwords_data_.ChooseCredential(form, credential_type); 301 passwords_data_.ChooseCredential(&form);
300 passwords_data_.TransitionToState(password_manager::ui::MANAGE_STATE); 302 passwords_data_.TransitionToState(password_manager::ui::MANAGE_STATE);
301 UpdateBubbleAndIconVisibility(); 303 UpdateBubbleAndIconVisibility();
302 } 304 }
303 305
304 void ManagePasswordsUIController::NavigateToExternalPasswordManager() { 306 void ManagePasswordsUIController::NavigateToExternalPasswordManager() {
305 chrome::NavigateParams params( 307 chrome::NavigateParams params(
306 chrome::FindBrowserWithWebContents(web_contents()), 308 chrome::FindBrowserWithWebContents(web_contents()),
307 GURL(password_manager::kPasswordManagerAccountDashboardURL), 309 GURL(password_manager::kPasswordManagerAccountDashboardURL),
308 ui::PAGE_TRANSITION_LINK); 310 ui::PAGE_TRANSITION_LINK);
309 params.disposition = NEW_FOREGROUND_TAB; 311 params.disposition = NEW_FOREGROUND_TAB;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 passwords_data_.TransitionToState(password_manager::ui::MANAGE_STATE); 425 passwords_data_.TransitionToState(password_manager::ui::MANAGE_STATE);
424 } 426 }
425 } 427 }
426 428
427 void ManagePasswordsUIController::WebContentsDestroyed() { 429 void ManagePasswordsUIController::WebContentsDestroyed() {
428 password_manager::PasswordStore* password_store = 430 password_manager::PasswordStore* password_store =
429 GetPasswordStore(web_contents()); 431 GetPasswordStore(web_contents());
430 if (password_store) 432 if (password_store)
431 password_store->RemoveObserver(this); 433 password_store->RemoveObserver(this);
432 } 434 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698