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

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

Issue 1961183002: MD Settings: Update some Settings handlers to use new JS lifecycle management. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/certificates_handler.cc
diff --git a/chrome/browser/ui/webui/settings/certificates_handler.cc b/chrome/browser/ui/webui/settings/certificates_handler.cc
index d104eec371b845bf8baa504bd9800892b238fe56..d39d4678767ff7cac80e0217cf5549c406f5eee5 100644
--- a/chrome/browser/ui/webui/settings/certificates_handler.cc
+++ b/chrome/browser/ui/webui/settings/certificates_handler.cc
@@ -985,14 +985,16 @@ void CertificatesHandler::CertificateManagerModelReady() {
certificate_manager_model_->is_user_db_available());
base::FundamentalValue tpm_available_value(
certificate_manager_model_->is_tpm_available());
- web_ui()->CallJavascriptFunction(
- "cr.webUIListenerCallback", base::StringValue("certificates-model-ready"),
- user_db_available_value, tpm_available_value);
+ CallJavascriptFunction("cr.webUIListenerCallback",
+ base::StringValue("certificates-model-ready"),
+ user_db_available_value, tpm_available_value);
certificate_manager_model_->Refresh();
}
void CertificatesHandler::HandleRefreshCertificates(
const base::ListValue* args) {
+ AllowJavascript();
+
if (certificate_manager_model_) {
// Already have a model, the webui must be re-loading. Just re-run the
// webui initialization.
@@ -1076,9 +1078,9 @@ void CertificatesHandler::PopulateTree(
}
std::sort(nodes->begin(), nodes->end(), comparator);
- web_ui()->CallJavascriptFunction("cr.webUIListenerCallback",
- base::StringValue("certificates-changed"),
- base::StringValue(tab_name), *nodes);
+ CallJavascriptFunction("cr.webUIListenerCallback",
+ base::StringValue("certificates-changed"),
+ base::StringValue(tab_name), *nodes);
}
}

Powered by Google App Engine
This is Rietveld 408576698