OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/webui/options/certificate_manager_handler.h" | 5 #include "chrome/browser/ui/webui/options/certificate_manager_handler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1001 } | 1001 } |
1002 } | 1002 } |
1003 | 1003 |
1004 void CertificateManagerHandler::OnCertificateManagerModelCreated( | 1004 void CertificateManagerHandler::OnCertificateManagerModelCreated( |
1005 scoped_ptr<CertificateManagerModel> model) { | 1005 scoped_ptr<CertificateManagerModel> model) { |
1006 certificate_manager_model_ = model.Pass(); | 1006 certificate_manager_model_ = model.Pass(); |
1007 CertificateManagerModelReady(); | 1007 CertificateManagerModelReady(); |
1008 } | 1008 } |
1009 | 1009 |
1010 void CertificateManagerHandler::CertificateManagerModelReady() { | 1010 void CertificateManagerHandler::CertificateManagerModelReady() { |
| 1011 base::FundamentalValue user_db_available_value( |
| 1012 certificate_manager_model_->is_user_db_available()); |
1011 base::FundamentalValue tpm_available_value( | 1013 base::FundamentalValue tpm_available_value( |
1012 certificate_manager_model_->is_tpm_available()); | 1014 certificate_manager_model_->is_tpm_available()); |
1013 web_ui()->CallJavascriptFunction("CertificateManager.onModelReady", | 1015 web_ui()->CallJavascriptFunction("CertificateManager.onModelReady", |
| 1016 user_db_available_value, |
1014 tpm_available_value); | 1017 tpm_available_value); |
1015 certificate_manager_model_->Refresh(); | 1018 certificate_manager_model_->Refresh(); |
1016 } | 1019 } |
1017 | 1020 |
1018 void CertificateManagerHandler::Populate(const base::ListValue* args) { | 1021 void CertificateManagerHandler::Populate(const base::ListValue* args) { |
1019 if (certificate_manager_model_) { | 1022 if (certificate_manager_model_) { |
1020 // Already have a model, the webui must be re-loading. Just re-run the | 1023 // Already have a model, the webui must be re-loading. Just re-run the |
1021 // webui initialization. | 1024 // webui initialization. |
1022 CertificateManagerModelReady(); | 1025 CertificateManagerModelReady(); |
1023 return; | 1026 return; |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1148 title_value, | 1151 title_value, |
1149 error_value, | 1152 error_value, |
1150 cert_error_list); | 1153 cert_error_list); |
1151 } | 1154 } |
1152 | 1155 |
1153 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { | 1156 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { |
1154 return web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(); | 1157 return web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(); |
1155 } | 1158 } |
1156 | 1159 |
1157 } // namespace options | 1160 } // namespace options |
OLD | NEW |