OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/settings/certificates_handler.h" | 5 #include "chrome/browser/ui/webui/settings/certificates_handler.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 }; | 78 }; |
79 | 79 |
80 std::string OrgNameToId(const std::string& org) { | 80 std::string OrgNameToId(const std::string& org) { |
81 return "org-" + org; | 81 return "org-" + org; |
82 } | 82 } |
83 | 83 |
84 struct DictionaryIdComparator { | 84 struct DictionaryIdComparator { |
85 explicit DictionaryIdComparator(icu::Collator* collator) | 85 explicit DictionaryIdComparator(icu::Collator* collator) |
86 : collator_(collator) {} | 86 : collator_(collator) {} |
87 | 87 |
88 bool operator()(const base::Value& a, const base::Value& b) const { | 88 bool operator()(const std::unique_ptr<base::Value>& a, |
89 DCHECK(a.GetType() == base::Value::Type::DICTIONARY); | 89 const std::unique_ptr<base::Value>& b) const { |
90 DCHECK(b.GetType() == base::Value::Type::DICTIONARY); | 90 DCHECK(a->GetType() == base::Value::Type::DICTIONARY); |
| 91 DCHECK(b->GetType() == base::Value::Type::DICTIONARY); |
91 const base::DictionaryValue* a_dict; | 92 const base::DictionaryValue* a_dict; |
92 bool a_is_dictionary = a.GetAsDictionary(&a_dict); | 93 bool a_is_dictionary = a->GetAsDictionary(&a_dict); |
93 DCHECK(a_is_dictionary); | 94 DCHECK(a_is_dictionary); |
94 const base::DictionaryValue* b_dict; | 95 const base::DictionaryValue* b_dict; |
95 bool b_is_dictionary = b.GetAsDictionary(&b_dict); | 96 bool b_is_dictionary = b->GetAsDictionary(&b_dict); |
96 DCHECK(b_is_dictionary); | 97 DCHECK(b_is_dictionary); |
97 base::string16 a_str; | 98 base::string16 a_str; |
98 base::string16 b_str; | 99 base::string16 b_str; |
99 a_dict->GetString(kNameField, &a_str); | 100 a_dict->GetString(kNameField, &a_str); |
100 b_dict->GetString(kNameField, &b_str); | 101 b_dict->GetString(kNameField, &b_str); |
101 if (collator_ == NULL) | 102 if (collator_ == NULL) |
102 return a_str < b_str; | 103 return a_str < b_str; |
103 return base::i18n::CompareString16WithCollator(*collator_, a_str, b_str) == | 104 return base::i18n::CompareString16WithCollator(*collator_, a_str, b_str) == |
104 UCOL_LESS; | 105 UCOL_LESS; |
105 } | 106 } |
(...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 error_info->Set(kCertificateErrors, | 1138 error_info->Set(kCertificateErrors, |
1138 base::WrapUnique(cert_error_list.release())); | 1139 base::WrapUnique(cert_error_list.release())); |
1139 RejectCallback(*error_info); | 1140 RejectCallback(*error_info); |
1140 } | 1141 } |
1141 | 1142 |
1142 gfx::NativeWindow CertificatesHandler::GetParentWindow() const { | 1143 gfx::NativeWindow CertificatesHandler::GetParentWindow() const { |
1143 return web_ui()->GetWebContents()->GetTopLevelNativeWindow(); | 1144 return web_ui()->GetWebContents()->GetTopLevelNativeWindow(); |
1144 } | 1145 } |
1145 | 1146 |
1146 } // namespace settings | 1147 } // namespace settings |
OLD | NEW |