| 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/extensions/api/passwords_private/passwords_private_api.
h" | 5 #include "chrome/browser/extensions/api/passwords_private/passwords_private_api.
h" |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "chrome/browser/extensions/api/passwords_private/passwords_private_dele
gate_factory.h" | 8 #include "chrome/browser/extensions/api/passwords_private/passwords_private_dele
gate_factory.h" |
| 9 #include "chrome/common/extensions/api/passwords_private.h" | 9 #include "chrome/common/extensions/api/passwords_private.h" |
| 10 #include "components/password_manager/core/common/experiments.h" | 10 #include "components/password_manager/core/common/experiments.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 delegate->RequestShowPassword(parameters->login_pair.origin_url, | 79 delegate->RequestShowPassword(parameters->login_pair.origin_url, |
| 80 parameters->login_pair.username, | 80 parameters->login_pair.username, |
| 81 GetSenderWebContents()); | 81 GetSenderWebContents()); |
| 82 | 82 |
| 83 // No response given from this API function; instead, listeners wait for the | 83 // No response given from this API function; instead, listeners wait for the |
| 84 // chrome.passwordsPrivate.onPlaintextPasswordRetrieved event to fire. | 84 // chrome.passwordsPrivate.onPlaintextPasswordRetrieved event to fire. |
| 85 return RespondNow(NoArguments()); | 85 return RespondNow(NoArguments()); |
| 86 } | 86 } |
| 87 | 87 |
| 88 //////////////////////////////////////////////////////////////////////////////// |
| 89 // PasswordsPrivateGetSavedPasswordListFunction |
| 90 |
| 91 PasswordsPrivateGetSavedPasswordListFunction:: |
| 92 ~PasswordsPrivateGetSavedPasswordListFunction() {} |
| 93 |
| 94 ExtensionFunction::ResponseAction |
| 95 PasswordsPrivateGetSavedPasswordListFunction::Run() { |
| 96 PasswordsPrivateDelegate* delegate = |
| 97 PasswordsPrivateDelegateFactory::GetForBrowserContext(browser_context(), |
| 98 true /* create */); |
| 99 return RespondNow(ArgumentList( |
| 100 api::passwords_private::GetSavedPasswordList::Results::Create( |
| 101 *(delegate->GetSavedPasswordsList())))); |
| 102 } |
| 103 |
| 104 //////////////////////////////////////////////////////////////////////////////// |
| 105 // PasswordsPrivateGetPasswordExceptionListFunction |
| 106 |
| 107 PasswordsPrivateGetPasswordExceptionListFunction:: |
| 108 ~PasswordsPrivateGetPasswordExceptionListFunction() {} |
| 109 |
| 110 ExtensionFunction::ResponseAction |
| 111 PasswordsPrivateGetPasswordExceptionListFunction::Run() { |
| 112 PasswordsPrivateDelegate* delegate = |
| 113 PasswordsPrivateDelegateFactory::GetForBrowserContext(browser_context(), |
| 114 true /* create */); |
| 115 return RespondNow(ArgumentList( |
| 116 api::passwords_private::GetPasswordExceptionList::Results::Create( |
| 117 *(delegate->GetPasswordExceptionsList())))); |
| 118 } |
| 119 |
| 88 } // namespace extensions | 120 } // namespace extensions |
| OLD | NEW |