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

Unified Diff: chrome/browser/ui/webui/settings/settings_cookies_view_handler.cc

Issue 2248683006: Site Settings Desktop: Implement individual cookie removal and RemoveAll. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback Created 4 years, 4 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/ui/webui/settings/settings_cookies_view_handler.cc
diff --git a/chrome/browser/ui/webui/settings/settings_cookies_view_handler.cc b/chrome/browser/ui/webui/settings/settings_cookies_view_handler.cc
index de86c6353ed0053014e66b788ffe31514f6072bd..1a30689308a3715057a40e7f86036d7ed1f0518d 100644
--- a/chrome/browser/ui/webui/settings/settings_cookies_view_handler.cc
+++ b/chrome/browser/ui/webui/settings/settings_cookies_view_handler.cc
@@ -177,6 +177,9 @@ void CookiesViewHandler::UpdateSearchResults(const base::ListValue* args) {
}
void CookiesViewHandler::RemoveAll(const base::ListValue* args) {
+ CHECK_EQ(1U, args->GetSize());
+ CHECK(args->GetString(0, &callback_id_));
+
EnsureCookiesTreeModelCreated();
cookies_tree_model_->DeleteAllStoredObjects();
}
@@ -195,8 +198,11 @@ void CookiesViewHandler::Remove(const base::ListValue* args) {
}
void CookiesViewHandler::LoadChildren(const base::ListValue* args) {
+ CHECK_LT(0U, args->GetSize());
+ CHECK(args->GetString(0, &callback_id_));
+
std::string node_path;
- if (!args->GetString(0, &node_path))
+ if (!args->GetString(1, &node_path))
return;
EnsureCookiesTreeModelCreated();
@@ -221,12 +227,14 @@ void CookiesViewHandler::SendChildren(const CookieTreeNode* parent) {
args.AppendString(model_util_->GetTreeNodeId(parent));
args.Append(std::move(children));
- CallJavascriptFunction("cr.webUIListenerCallback",
- base::StringValue("loadChildren"),
- args);
+ ResolveJavascriptCallback(base::StringValue(callback_id_), args);
+ callback_id_ = "";
}
void CookiesViewHandler::ReloadCookies(const base::ListValue* args) {
+ CHECK_EQ(1U, args->GetSize());
+ CHECK(args->GetString(0, &callback_id_));
+
cookies_tree_model_.reset();
EnsureCookiesTreeModelCreated();

Powered by Google App Engine
This is Rietveld 408576698