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

Unified Diff: chrome/browser/extensions/api/passwords_private/passwords_private_api.cc

Issue 1892613006: Add functions to the passwords private api that update the lists. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add callback 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698