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

Unified Diff: chrome/browser/certificate_manager_model.h

Issue 2307373003: Show extension provided certificates in chrome://settings/certificates (Closed)
Patch Set: Fix trybot errors 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
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..7a895fcf9caaf7f15f194c1e2e10b8deca2182c5 100644
--- a/chrome/browser/certificate_manager_model.h
+++ b/chrome/browser/certificate_manager_model.h
@@ -13,6 +13,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string16.h"
+#include "chrome/browser/chromeos/certificate_provider/certificate_provider.h"
#include "net/cert/nss_cert_database.h"
namespace content {
@@ -132,7 +133,8 @@ class CertificateManagerModel {
CertificateManagerModel(net::NSSCertDatabase* nss_cert_database,
bool is_user_db_available,
bool is_tpm_available,
- Observer* observer);
+ Observer* observer,
+ content::BrowserContext* browser_context);
// Methods used during initialization, see the comment at the top of the .cc
// file for details.
@@ -141,21 +143,27 @@ class CertificateManagerModel {
bool is_user_db_available,
bool is_tpm_available,
CertificateManagerModel::Observer* observer,
+ content::BrowserContext* browser_context,
const CreationCallback& callback);
static void DidGetCertDBOnIOThread(
CertificateManagerModel::Observer* observer,
+ content::BrowserContext* browser_context,
const CreationCallback& callback,
net::NSSCertDatabase* cert_db);
- static void GetCertDBOnIOThread(content::ResourceContext* context,
- CertificateManagerModel::Observer* observer,
+ static void GetCertDBOnIOThread(CertificateManagerModel::Observer* observer,
+ content::BrowserContext* browser_context,
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 +172,11 @@ 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> certificate_provider_;
+
+ base::WeakPtrFactory<CertificateManagerModel> weak_ptr_factory_;
emaxx 2016/09/06 16:17:03 nit: #include "base/memory/weak_ptr.h"
Ivan Šandrk 2016/09/06 16:27:53 Done.
+
DISALLOW_COPY_AND_ASSIGN(CertificateManagerModel);
};

Powered by Google App Engine
This is Rietveld 408576698