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

Unified Diff: chrome/browser/certificate_manager_model.h

Issue 2307373003: Show extension provided certificates in chrome://settings/certificates (Closed)
Patch Set: thestig's nits Created 4 years, 3 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
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/certificate_manager_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/certificate_manager_model.h
diff --git a/chrome/browser/certificate_manager_model.h b/chrome/browser/certificate_manager_model.h
index 64fcb2c467339cbe403850183e33d0ba1d7babbe..81e65e48cf889b40e069157737e5d6df24a7e853 100644
--- a/chrome/browser/certificate_manager_model.h
+++ b/chrome/browser/certificate_manager_model.h
@@ -12,9 +12,14 @@
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
#include "base/strings/string16.h"
#include "net/cert/nss_cert_database.h"
+namespace chromeos {
+class CertificateProvider;
+} // namespace chromeos
+
namespace content {
class BrowserContext;
class ResourceContext;
@@ -129,10 +134,13 @@ class CertificateManagerModel {
bool IsHardwareBacked(const net::X509Certificate* cert) const;
private:
- CertificateManagerModel(net::NSSCertDatabase* nss_cert_database,
- bool is_user_db_available,
- bool is_tpm_available,
- Observer* observer);
+ CertificateManagerModel(
+ net::NSSCertDatabase* nss_cert_database,
+ bool is_user_db_available,
+ bool is_tpm_available,
+ Observer* observer,
+ std::unique_ptr<chromeos::CertificateProvider>
+ extension_certificate_provider);
// Methods used during initialization, see the comment at the top of the .cc
// file for details.
@@ -141,21 +149,32 @@ class CertificateManagerModel {
bool is_user_db_available,
bool is_tpm_available,
CertificateManagerModel::Observer* observer,
+ std::unique_ptr<chromeos::CertificateProvider>
+ extension_certificate_provider,
const CreationCallback& callback);
static void DidGetCertDBOnIOThread(
CertificateManagerModel::Observer* observer,
+ std::unique_ptr<chromeos::CertificateProvider>
+ extension_certificate_provider,
const CreationCallback& callback,
net::NSSCertDatabase* cert_db);
- static void GetCertDBOnIOThread(content::ResourceContext* context,
- CertificateManagerModel::Observer* observer,
- const CreationCallback& callback);
+ static void GetCertDBOnIOThread(
+ content::ResourceContext* context,
+ CertificateManagerModel::Observer* observer,
+ std::unique_ptr<chromeos::CertificateProvider>
+ extension_certificate_provider,
+ const CreationCallback& callback);
// Callback used by Refresh() for when the cert slots have been unlocked.
// This method does the actual refreshing.
void RefreshSlotsUnlocked();
+ // Callback used to refresh extension provided certificates. Refreshes UI.
+ void RefreshExtensionCertificates(const net::CertificateList& new_certs);
+
net::NSSCertDatabase* cert_db_;
net::CertificateList cert_list_;
+ net::CertificateList extension_cert_list_;
// Whether the certificate database has a public slot associated with the
// profile. If not set, importing certificates is not allowed with this model.
bool is_user_db_available_;
@@ -164,6 +183,12 @@ class CertificateManagerModel {
// The observer to notify when certificate list is refreshed.
Observer* observer_;
+ // Certificate provider used to fetch extension provided certificates.
+ std::unique_ptr<chromeos::CertificateProvider>
+ extension_certificate_provider_;
+
+ base::WeakPtrFactory<CertificateManagerModel> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(CertificateManagerModel);
};
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/certificate_manager_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698