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

Side by Side Diff: chrome/browser/safe_browsing/incident_reporting/extension_data_collection.cc

Issue 2230203002: chrome: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed accidental components/ change Created 4 years, 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/safe_browsing/incident_reporting/extension_data_collect ion.h" 5 #include "chrome/browser/safe_browsing/incident_reporting/extension_data_collect ion.h"
6 6
7 #include "base/json/json_string_value_serializer.h" 7 #include "base/json/json_string_value_serializer.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/version.h" 9 #include "base/version.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 extension_info->set_may_be_untrusted(extension.may_be_untrusted()); 69 extension_info->set_may_be_untrusted(extension.may_be_untrusted());
70 extension_info->set_install_time_msec( 70 extension_info->set_install_time_msec(
71 extension_prefs.GetInstallTime(extension.id()).ToJavaTime()); 71 extension_prefs.GetInstallTime(extension.id()).ToJavaTime());
72 72
73 const base::DictionaryValue* signature = 73 const base::DictionaryValue* signature =
74 extension_prefs.GetInstallSignature(); 74 extension_prefs.GetInstallSignature();
75 if (signature) { 75 if (signature) {
76 std::unique_ptr<extensions::InstallSignature> signature_from_prefs = 76 std::unique_ptr<extensions::InstallSignature> signature_from_prefs =
77 extensions::InstallSignature::FromValue(*signature); 77 extensions::InstallSignature::FromValue(*signature);
78 if (signature_from_prefs) { 78 if (signature_from_prefs) {
79 if (ContainsKey(signature_from_prefs->ids, extension_id)) { 79 if (base::ContainsKey(signature_from_prefs->ids, extension_id)) {
80 extension_info->set_has_signature_validation(true); 80 extension_info->set_has_signature_validation(true);
81 extension_info->set_signature_is_valid(true); 81 extension_info->set_signature_is_valid(true);
82 } else if (ContainsKey(signature_from_prefs->invalid_ids, extension_id)) { 82 } else if (base::ContainsKey(signature_from_prefs->invalid_ids,
83 extension_id)) {
83 extension_info->set_has_signature_validation(true); 84 extension_info->set_has_signature_validation(true);
84 extension_info->set_signature_is_valid(false); 85 extension_info->set_signature_is_valid(false);
85 } 86 }
86 } 87 }
87 } 88 }
88 89
89 std::string manifest_json; 90 std::string manifest_json;
90 JSONStringValueSerializer serializer(&manifest_json); 91 JSONStringValueSerializer serializer(&manifest_json);
91 if (serializer.Serialize(*extension.manifest()->value())) 92 if (serializer.Serialize(*extension.manifest()->value()))
92 extension_info->mutable_manifest()->swap(manifest_json); 93 extension_info->mutable_manifest()->swap(manifest_json);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 *last_installed_extension, 132 *last_installed_extension,
132 *extensions::ExtensionPrefs::Get(profile_for_last_installed_extension), 133 *extensions::ExtensionPrefs::Get(profile_for_last_installed_extension),
133 *extensions::ExtensionRegistryFactory::GetForBrowserContext( 134 *extensions::ExtensionRegistryFactory::GetForBrowserContext(
134 profile_for_last_installed_extension), 135 profile_for_last_installed_extension),
135 data->mutable_last_installed_extension()); 136 data->mutable_last_installed_extension());
136 } 137 }
137 #endif 138 #endif
138 } 139 }
139 140
140 } // namespace safe_browsing 141 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698