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/plugins/plugin_finder.h" | 5 #include "chrome/browser/plugins/plugin_finder.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 std::string version; | 131 std::string version; |
132 success = version_dict->GetString("version", &version); | 132 success = version_dict->GetString("version", &version); |
133 DCHECK(success); | 133 DCHECK(success); |
134 std::string status_str; | 134 std::string status_str; |
135 success = version_dict->GetString("status", &status_str); | 135 success = version_dict->GetString("status", &status_str); |
136 DCHECK(success); | 136 DCHECK(success); |
137 PluginMetadata::SecurityStatus status = | 137 PluginMetadata::SecurityStatus status = |
138 PluginMetadata::SECURITY_STATUS_UP_TO_DATE; | 138 PluginMetadata::SECURITY_STATUS_UP_TO_DATE; |
139 success = PluginMetadata::ParseSecurityStatus(status_str, &status); | 139 success = PluginMetadata::ParseSecurityStatus(status_str, &status); |
140 DCHECK(success); | 140 DCHECK(success); |
141 plugin->AddVersion(Version(version), status); | 141 plugin->AddVersion(base::Version(version), status); |
142 } | 142 } |
143 } | 143 } |
144 | 144 |
145 LoadMimeTypes(false, plugin_dict, plugin); | 145 LoadMimeTypes(false, plugin_dict, plugin); |
146 LoadMimeTypes(true, plugin_dict, plugin); | 146 LoadMimeTypes(true, plugin_dict, plugin); |
147 return plugin; | 147 return plugin; |
148 } | 148 } |
149 | 149 |
150 void RecordBuiltInPluginListError(PluginListError error_code) { | 150 void RecordBuiltInPluginListError(PluginListError error_code) { |
151 UMA_HISTOGRAM_ENUMERATION("PluginFinder.BuiltInPluginList.ErrorCode", | 151 UMA_HISTOGRAM_ENUMERATION("PluginFinder.BuiltInPluginList.ErrorCode", |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 metadata->AddMatchingMimeType(plugin.mime_types[i].mime_type); | 353 metadata->AddMatchingMimeType(plugin.mime_types[i].mime_type); |
354 | 354 |
355 DCHECK(metadata->MatchesPlugin(plugin)); | 355 DCHECK(metadata->MatchesPlugin(plugin)); |
356 if (identifier_plugin_.find(identifier) != identifier_plugin_.end()) | 356 if (identifier_plugin_.find(identifier) != identifier_plugin_.end()) |
357 identifier = GetLongIdentifier(plugin); | 357 identifier = GetLongIdentifier(plugin); |
358 | 358 |
359 DCHECK(identifier_plugin_.find(identifier) == identifier_plugin_.end()); | 359 DCHECK(identifier_plugin_.find(identifier) == identifier_plugin_.end()); |
360 identifier_plugin_[identifier] = metadata; | 360 identifier_plugin_[identifier] = metadata; |
361 return metadata->Clone(); | 361 return metadata->Clone(); |
362 } | 362 } |
OLD | NEW |