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

Side by Side Diff: chrome/browser/ui/webui/options/certificate_manager_handler.cc

Issue 2740143002: Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Rebase 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 (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
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 std::unique_ptr<base::Value>& a, 91 bool operator()(const base::Value& a, const base::Value& b) const {
92 const std::unique_ptr<base::Value>& b) const {
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(kNameId, &a_str); 100 a_dict->GetString(kNameId, &a_str);
102 b_dict->GetString(kNameId, &b_str); 101 b_dict->GetString(kNameId, &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 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after
1231 web_ui()->CallJavascriptFunctionUnsafe("CertificateImportErrorOverlay.show", 1230 web_ui()->CallJavascriptFunctionUnsafe("CertificateImportErrorOverlay.show",
1232 title_value, error_value, 1231 title_value, error_value,
1233 cert_error_list); 1232 cert_error_list);
1234 } 1233 }
1235 1234
1236 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const { 1235 gfx::NativeWindow CertificateManagerHandler::GetParentWindow() const {
1237 return web_ui()->GetWebContents()->GetTopLevelNativeWindow(); 1236 return web_ui()->GetWebContents()->GetTopLevelNativeWindow();
1238 } 1237 }
1239 1238
1240 } // namespace options 1239 } // namespace options
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698