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_SSL_SSL_ERROR_INFO_H_ | 5 #ifndef CHROME_BROWSER_SSL_SSL_ERROR_INFO_H_ |
6 #define CHROME_BROWSER_SSL_SSL_ERROR_INFO_H_ | 6 #define CHROME_BROWSER_SSL_SSL_ERROR_INFO_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
| 12 #include "base/string16.h" |
12 #include "net/base/x509_certificate.h" | 13 #include "net/base/x509_certificate.h" |
13 | 14 |
14 class GURL; | 15 class GURL; |
15 | 16 |
16 // This class describes an error that happened while showing a page over SSL. | 17 // This class describes an error that happened while showing a page over SSL. |
17 // An SSLErrorInfo object only exists on the UI thread and only contains | 18 // An SSLErrorInfo object only exists on the UI thread and only contains |
18 // information about an error (type of error and text details). | 19 // information about an error (type of error and text details). |
19 // Note no DISALLOW_COPY_AND_ASSIGN as we want the copy constructor. | 20 // Note no DISALLOW_COPY_AND_ASSIGN as we want the copy constructor. |
20 class SSLErrorInfo { | 21 class SSLErrorInfo { |
21 public: | 22 public: |
(...skipping 22 matching lines...) Expand all Loading... |
44 | 45 |
45 // Populates the specified |errors| vector with the errors contained in | 46 // Populates the specified |errors| vector with the errors contained in |
46 // |cert_status|. Returns the number of errors found. | 47 // |cert_status|. Returns the number of errors found. |
47 // Callers only interested in the error count can pass NULL for |errors|. | 48 // Callers only interested in the error count can pass NULL for |errors|. |
48 static int GetErrorsForCertStatus(int cert_status, | 49 static int GetErrorsForCertStatus(int cert_status, |
49 int cert_id, | 50 int cert_id, |
50 const GURL& request_url, | 51 const GURL& request_url, |
51 std::vector<SSLErrorInfo>* errors); | 52 std::vector<SSLErrorInfo>* errors); |
52 | 53 |
53 // A title describing the error, usually to be used with the details below. | 54 // A title describing the error, usually to be used with the details below. |
54 const std::wstring& title() const { return title_; } | 55 const string16& title() const { return title_; } |
55 | 56 |
56 // A description of the error. | 57 // A description of the error. |
57 const std::wstring& details() const { return details_; } | 58 const string16& details() const { return details_; } |
58 | 59 |
59 // A short message describing the error (1 line). | 60 // A short message describing the error (1 line). |
60 const std::wstring& short_description() const { return short_description_; } | 61 const string16& short_description() const { return short_description_; } |
61 | 62 |
62 // A lengthy explanation of what the error is. Each entry in the returned | 63 // A lengthy explanation of what the error is. Each entry in the returned |
63 // vector is a paragraph. | 64 // vector is a paragraph. |
64 const std::vector<std::wstring>& extra_information() const { | 65 const std::vector<string16>& extra_information() const { |
65 return extra_information_; | 66 return extra_information_; |
66 } | 67 } |
67 | 68 |
68 private: | 69 private: |
69 SSLErrorInfo(const std::wstring& title, | 70 SSLErrorInfo(const string16& title, |
70 const std::wstring& details, | 71 const string16& details, |
71 const std::wstring& short_description, | 72 const string16& short_description, |
72 const std::vector<std::wstring>& extra_info); | 73 const std::vector<string16>& extra_info); |
73 | 74 |
74 std::wstring title_; | 75 string16 title_; |
75 std::wstring details_; | 76 string16 details_; |
76 std::wstring short_description_; | 77 string16 short_description_; |
77 // Extra-informations contains paragraphs of text explaining in details what | 78 // Extra-informations contains paragraphs of text explaining in details what |
78 // the error is and what the risks are. | 79 // the error is and what the risks are. |
79 std::vector<std::wstring> extra_information_; | 80 std::vector<string16> extra_information_; |
80 }; | 81 }; |
81 | 82 |
82 #endif // CHROME_BROWSER_SSL_SSL_ERROR_INFO_H_ | 83 #endif // CHROME_BROWSER_SSL_SSL_ERROR_INFO_H_ |
OLD | NEW |