| OLD | NEW |
| 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 "components/password_manager/content/browser/credential_manager_dispatc
her.h" | 5 #include "components/password_manager/content/browser/credential_manager_dispatc
her.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/prefs/pref_registry_simple.h" | 9 #include "base/prefs/pref_registry_simple.h" |
| 10 #include "base/prefs/testing_pref_service.h" | 10 #include "base/prefs/testing_pref_service.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 base::Callback<void( | 52 base::Callback<void( |
| 53 const password_manager::CredentialInfo&)> callback)); | 53 const password_manager::CredentialInfo&)> callback)); |
| 54 | 54 |
| 55 MockPasswordManagerClient(password_manager::PasswordStore* store) | 55 MockPasswordManagerClient(password_manager::PasswordStore* store) |
| 56 : store_(store) { | 56 : store_(store) { |
| 57 prefs_.registry()->RegisterBooleanPref( | 57 prefs_.registry()->RegisterBooleanPref( |
| 58 password_manager::prefs::kPasswordManagerAutoSignin, true); | 58 password_manager::prefs::kPasswordManagerAutoSignin, true); |
| 59 } | 59 } |
| 60 ~MockPasswordManagerClient() override {} | 60 ~MockPasswordManagerClient() override {} |
| 61 | 61 |
| 62 bool PromptUserToSavePassword( | 62 bool PromptUserToSaveOrUpdatePassword( |
| 63 scoped_ptr<password_manager::PasswordFormManager> manager, | 63 scoped_ptr<password_manager::PasswordFormManager> manager, |
| 64 password_manager::CredentialSourceType type) override { | 64 password_manager::CredentialSourceType type, |
| 65 bool update_password) override { |
| 65 manager_.swap(manager); | 66 manager_.swap(manager); |
| 66 PromptUserToSavePasswordPtr(manager_.get(), type); | 67 PromptUserToSavePasswordPtr(manager_.get(), type); |
| 67 return true; | 68 return true; |
| 68 } | 69 } |
| 69 | 70 |
| 70 password_manager::PasswordStore* GetPasswordStore() const override { | 71 password_manager::PasswordStore* GetPasswordStore() const override { |
| 71 return store_; | 72 return store_; |
| 72 } | 73 } |
| 73 | 74 |
| 74 PrefService* GetPrefs() override { return &prefs_; } | 75 PrefService* GetPrefs() override { return &prefs_; } |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 const uint32 kMsgID = CredentialManagerMsg_SendCredential::ID; | 612 const uint32 kMsgID = CredentialManagerMsg_SendCredential::ID; |
| 612 const IPC::Message* message = | 613 const IPC::Message* message = |
| 613 process()->sink().GetFirstMessageMatching(kMsgID); | 614 process()->sink().GetFirstMessageMatching(kMsgID); |
| 614 ASSERT_TRUE(message); | 615 ASSERT_TRUE(message); |
| 615 CredentialManagerMsg_SendCredential::Param param; | 616 CredentialManagerMsg_SendCredential::Param param; |
| 616 CredentialManagerMsg_SendCredential::Read(message, ¶m); | 617 CredentialManagerMsg_SendCredential::Read(message, ¶m); |
| 617 EXPECT_EQ(CredentialType::CREDENTIAL_TYPE_EMPTY, base::get<1>(param).type); | 618 EXPECT_EQ(CredentialType::CREDENTIAL_TYPE_EMPTY, base::get<1>(param).type); |
| 618 } | 619 } |
| 619 | 620 |
| 620 } // namespace password_manager | 621 } // namespace password_manager |
| OLD | NEW |