OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/options/certificate_manager_handler.h" | 5 #include "chrome/browser/ui/webui/options/certificate_manager_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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 *result = string_value[0] == 't'; | 82 *result = string_value[0] == 't'; |
83 return true; | 83 return true; |
84 } | 84 } |
85 | 85 |
86 struct DictionaryIdComparator { | 86 struct DictionaryIdComparator { |
87 explicit DictionaryIdComparator(icu::Collator* collator) | 87 explicit DictionaryIdComparator(icu::Collator* collator) |
88 : collator_(collator) { | 88 : collator_(collator) { |
89 } | 89 } |
90 | 90 |
91 bool operator()(const base::Value& a, const base::Value& b) const { | 91 bool operator()(const std::unique_ptr<base::Value>& a, |
| 92 const std::unique_ptr<base::Value>& b) const { |
92 const base::DictionaryValue* a_dict; | 93 const base::DictionaryValue* a_dict; |
93 bool a_is_dictionary = a.GetAsDictionary(&a_dict); | 94 bool a_is_dictionary = a->GetAsDictionary(&a_dict); |
94 DCHECK(a_is_dictionary); | 95 DCHECK(a_is_dictionary); |
95 const base::DictionaryValue* b_dict; | 96 const base::DictionaryValue* b_dict; |
96 bool b_is_dictionary = b.GetAsDictionary(&b_dict); | 97 bool b_is_dictionary = b->GetAsDictionary(&b_dict); |
97 DCHECK(b_is_dictionary); | 98 DCHECK(b_is_dictionary); |
98 base::string16 a_str; | 99 base::string16 a_str; |
99 base::string16 b_str; | 100 base::string16 b_str; |
100 a_dict->GetString(kNameId, &a_str); | 101 a_dict->GetString(kNameId, &a_str); |
101 b_dict->GetString(kNameId, &b_str); | 102 b_dict->GetString(kNameId, &b_str); |
102 if (collator_ == NULL) | 103 if (collator_ == NULL) |
103 return a_str < b_str; | 104 return a_str < b_str; |
104 return base::i18n::CompareString16WithCollator(*collator_, a_str, b_str) == | 105 return base::i18n::CompareString16WithCollator(*collator_, a_str, b_str) == |
105 UCOL_LESS; | 106 UCOL_LESS; |
106 } | 107 } |
(...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1230 web_ui()->CallJavascriptFunctionUnsafe("CertificateImportErrorOverlay.show", | 1231 web_ui()->CallJavascriptFunctionUnsafe("CertificateImportErrorOverlay.show", |
1231 title_value, error_value, | 1232 title_value, error_value, |
1232 cert_error_list); | 1233 cert_error_list); |
1233 } | 1234 } |
1234 | 1235 |
1235 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { | 1236 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { |
1236 return web_ui()->GetWebContents()->GetTopLevelNativeWindow(); | 1237 return web_ui()->GetWebContents()->GetTopLevelNativeWindow(); |
1237 } | 1238 } |
1238 | 1239 |
1239 } // namespace options | 1240 } // namespace options |
OLD | NEW |