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