Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: chrome/browser/ui/webui/settings/certificates_handler.cc

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/language_options_handler_common.cc ('k') | chrome/browser/ui/webui/site_settings_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698