OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/password_dialog_controller_impl.h" | 5 #include "chrome/browser/ui/passwords/password_dialog_controller_impl.h" |
6 | 6 |
7 #include "chrome/browser/sync/profile_sync_service_factory.h" | 7 #include "chrome/browser/sync/profile_sync_service_factory.h" |
8 #include "chrome/browser/ui/passwords/account_chooser_prompt.h" | 8 #include "chrome/browser/ui/passwords/account_chooser_prompt.h" |
9 #include "chrome/browser/ui/passwords/manage_passwords_view_utils.h" | 9 #include "chrome/browser/ui/passwords/manage_passwords_view_utils.h" |
10 #include "chrome/browser/ui/passwords/passwords_model_delegate.h" | 10 #include "chrome/browser/ui/passwords/passwords_model_delegate.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 PasswordDialogControllerImpl::~PasswordDialogControllerImpl() { | 31 PasswordDialogControllerImpl::~PasswordDialogControllerImpl() { |
32 ResetDialog(); | 32 ResetDialog(); |
33 } | 33 } |
34 | 34 |
35 void PasswordDialogControllerImpl::ShowAccountChooser( | 35 void PasswordDialogControllerImpl::ShowAccountChooser( |
36 AccountChooserPrompt* dialog, | 36 AccountChooserPrompt* dialog, |
37 std::vector<scoped_ptr<autofill::PasswordForm>> locals, | 37 std::vector<scoped_ptr<autofill::PasswordForm>> locals, |
38 std::vector<scoped_ptr<autofill::PasswordForm>> federations) { | 38 std::vector<scoped_ptr<autofill::PasswordForm>> federations) { |
39 DCHECK(!current_dialog_); | 39 DCHECK(!current_dialog_); |
| 40 DCHECK(dialog); |
40 local_credentials_.swap(locals); | 41 local_credentials_.swap(locals); |
41 federated_credentials_.swap(federations); | 42 federated_credentials_.swap(federations); |
42 current_dialog_ = dialog; | 43 current_dialog_ = dialog; |
43 current_dialog_->Show(); | 44 current_dialog_->Show(); |
44 } | 45 } |
45 | 46 |
46 const PasswordDialogController::FormsVector& | 47 const PasswordDialogController::FormsVector& |
47 PasswordDialogControllerImpl::GetLocalForms() const { | 48 PasswordDialogControllerImpl::GetLocalForms() const { |
48 return local_credentials_; | 49 return local_credentials_; |
49 } | 50 } |
(...skipping 29 matching lines...) Expand all Loading... |
79 // The dialog isn't a bubble but ManagePasswordsUIController handles this. | 80 // The dialog isn't a bubble but ManagePasswordsUIController handles this. |
80 delegate_->OnBubbleHidden(); | 81 delegate_->OnBubbleHidden(); |
81 } | 82 } |
82 | 83 |
83 void PasswordDialogControllerImpl::ResetDialog() { | 84 void PasswordDialogControllerImpl::ResetDialog() { |
84 if (current_dialog_) { | 85 if (current_dialog_) { |
85 current_dialog_->ControllerGone(); | 86 current_dialog_->ControllerGone(); |
86 current_dialog_ = nullptr; | 87 current_dialog_ = nullptr; |
87 } | 88 } |
88 } | 89 } |
OLD | NEW |