| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_ | 5 #ifndef CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_ |
| 6 #define CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_ | 6 #define CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/ref_counted.h" | 11 #include "base/ref_counted.h" |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "net/base/cert_database.h" | 13 #include "net/base/cert_database.h" |
| 14 | 14 |
| 15 // CertificateManagerModel provides the data to be displayed in the certificate | 15 // CertificateManagerModel provides the data to be displayed in the certificate |
| 16 // manager dialog, and processes changes from the view. | 16 // manager dialog, and processes changes from the view. |
| 17 class CertificateManagerModel { | 17 class CertificateManagerModel { |
| 18 public: | 18 public: |
| 19 // Map from the subject organization name to the list of certs from that | 19 // Map from the subject organization name to the list of certs from that |
| 20 // organization. If a cert does not have an organization name, the | 20 // organization. If a cert does not have an organization name, the |
| 21 // subject's CertPrincipal::GetDisplayName() value is used instead. | 21 // subject's CertPrincipal::GetDisplayName() value is used instead. |
| 22 typedef std::map<std::string, net::CertificateList> OrgGroupingMap; | 22 typedef std::map<std::string, net::CertificateList> OrgGroupingMap; |
| 23 | 23 |
| 24 // Enumeration of the possible columns in the certificate manager tree view. | 24 // Enumeration of the possible columns in the certificate manager tree view. |
| 25 enum Column { | 25 enum Column { |
| 26 COL_SUBJECT_NAME, | 26 COL_SUBJECT_NAME, |
| 27 COL_CERTIFICATE_STORE, | 27 COL_CERTIFICATE_STORE, |
| 28 COL_SERIAL_NUMBER, | 28 COL_SERIAL_NUMBER, |
| 29 COL_EXPIRES_ON, | 29 COL_EXPIRES_ON, |
| 30 COL_EMAIL_ADDRESS, | |
| 31 }; | 30 }; |
| 32 | 31 |
| 33 class Observer { | 32 class Observer { |
| 34 public: | 33 public: |
| 35 // Called to notify the view that the certificate list has been refreshed. | 34 // Called to notify the view that the certificate list has been refreshed. |
| 36 // TODO(mattm): do a more granular updating strategy? Maybe retrieve new | 35 // TODO(mattm): do a more granular updating strategy? Maybe retrieve new |
| 37 // list of certs, diff against past list, and then notify of the changes? | 36 // list of certs, diff against past list, and then notify of the changes? |
| 38 virtual void CertificatesRefreshed() = 0; | 37 virtual void CertificatesRefreshed() = 0; |
| 39 }; | 38 }; |
| 40 | 39 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 net::CertDatabase cert_db_; | 100 net::CertDatabase cert_db_; |
| 102 net::CertificateList cert_list_; | 101 net::CertificateList cert_list_; |
| 103 | 102 |
| 104 // The observer to notify when certificate list is refreshed. | 103 // The observer to notify when certificate list is refreshed. |
| 105 Observer* observer_; | 104 Observer* observer_; |
| 106 | 105 |
| 107 DISALLOW_COPY_AND_ASSIGN(CertificateManagerModel); | 106 DISALLOW_COPY_AND_ASSIGN(CertificateManagerModel); |
| 108 }; | 107 }; |
| 109 | 108 |
| 110 #endif // CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_ | 109 #endif // CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_ |
| OLD | NEW |