Chromium Code Reviews| Index: chrome/browser/extensions/api/passwords_private/passwords_private_api.cc |
| diff --git a/chrome/browser/extensions/api/passwords_private/passwords_private_api.cc b/chrome/browser/extensions/api/passwords_private/passwords_private_api.cc |
| index a74dc022928a4f70b467175aa50101e46fdd0bd9..0bec57b6c1f12596c8680baf907dc4a7112d776e 100644 |
| --- a/chrome/browser/extensions/api/passwords_private/passwords_private_api.cc |
| +++ b/chrome/browser/extensions/api/passwords_private/passwords_private_api.cc |
| @@ -85,4 +85,42 @@ ExtensionFunction::ResponseAction |
| return RespondNow(NoArguments()); |
| } |
| +//////////////////////////////////////////////////////////////////////////////// |
| +// PasswordsPrivateRequestSavedPasswordListFunction |
| + |
| +PasswordsPrivateRequestSavedPasswordListFunction:: |
| + ~PasswordsPrivateRequestSavedPasswordListFunction() {} |
| + |
| +ExtensionFunction::ResponseAction |
| +PasswordsPrivateRequestSavedPasswordListFunction::Run() { |
| + PasswordsPrivateDelegate* delegate = |
| + PasswordsPrivateDelegateFactory::GetForBrowserContext(browser_context(), |
| + true /* create */); |
| + std::unique_ptr<base::ListValue> event_args = |
| + api::passwords_private::OnSavedPasswordsListChanged::Create( |
| + *(delegate->GetSavedPasswordsList())); |
| + base::ListValue* entries = nullptr; |
| + event_args->GetList(0, &entries); |
|
stevenjb
2016/04/19 20:59:17
I believe that if this is called with no entries a
hcarmona
2016/04/19 23:07:45
I fixed my issue. I was creating an event object a
stevenjb
2016/04/19 23:13:38
Ah. Yes, this is better.
|
| + return RespondNow(OneArgument(entries->CreateDeepCopy())); |
| +} |
| + |
| +//////////////////////////////////////////////////////////////////////////////// |
| +// PasswordsPrivateRequestPasswordExceptionListFunction |
| + |
| +PasswordsPrivateRequestPasswordExceptionListFunction:: |
| + ~PasswordsPrivateRequestPasswordExceptionListFunction() {} |
| + |
| +ExtensionFunction::ResponseAction |
| +PasswordsPrivateRequestPasswordExceptionListFunction::Run() { |
| + PasswordsPrivateDelegate* delegate = |
| + PasswordsPrivateDelegateFactory::GetForBrowserContext(browser_context(), |
| + true /* create */); |
| + std::unique_ptr<base::ListValue> event_args = |
| + api::passwords_private::OnPasswordExceptionsListChanged::Create( |
| + *(delegate->GetPasswordExceptionsList())); |
| + base::ListValue* exceptions = nullptr; |
| + event_args->GetList(0, &exceptions); |
|
stevenjb
2016/04/19 20:59:17
Same here.
hcarmona
2016/04/19 23:07:45
Same changes here.
|
| + return RespondNow(OneArgument(exceptions->CreateDeepCopy())); |
| +} |
| + |
| } // namespace extensions |