| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 std::string version; | 129 std::string version; |
| 130 success = version_dict->GetString("version", &version); | 130 success = version_dict->GetString("version", &version); |
| 131 DCHECK(success); | 131 DCHECK(success); |
| 132 std::string status_str; | 132 std::string status_str; |
| 133 success = version_dict->GetString("status", &status_str); | 133 success = version_dict->GetString("status", &status_str); |
| 134 DCHECK(success); | 134 DCHECK(success); |
| 135 PluginMetadata::SecurityStatus status = | 135 PluginMetadata::SecurityStatus status = |
| 136 PluginMetadata::SECURITY_STATUS_UP_TO_DATE; | 136 PluginMetadata::SECURITY_STATUS_UP_TO_DATE; |
| 137 success = PluginMetadata::ParseSecurityStatus(status_str, &status); | 137 success = PluginMetadata::ParseSecurityStatus(status_str, &status); |
| 138 DCHECK(success); | 138 DCHECK(success); |
| 139 plugin->AddVersion(base::Version(version), status); | 139 plugin->AddVersion(Version(version), status); |
| 140 } | 140 } |
| 141 } | 141 } |
| 142 | 142 |
| 143 LoadMimeTypes(false, plugin_dict, plugin); | 143 LoadMimeTypes(false, plugin_dict, plugin); |
| 144 LoadMimeTypes(true, plugin_dict, plugin); | 144 LoadMimeTypes(true, plugin_dict, plugin); |
| 145 return plugin; | 145 return plugin; |
| 146 } | 146 } |
| 147 | 147 |
| 148 void RecordBuiltInPluginListError(PluginListError error_code) { | 148 void RecordBuiltInPluginListError(PluginListError error_code) { |
| 149 UMA_HISTOGRAM_ENUMERATION("PluginFinder.BuiltInPluginList.ErrorCode", | 149 UMA_HISTOGRAM_ENUMERATION("PluginFinder.BuiltInPluginList.ErrorCode", |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 metadata->AddMatchingMimeType(plugin.mime_types[i].mime_type); | 376 metadata->AddMatchingMimeType(plugin.mime_types[i].mime_type); |
| 377 | 377 |
| 378 DCHECK(metadata->MatchesPlugin(plugin)); | 378 DCHECK(metadata->MatchesPlugin(plugin)); |
| 379 if (identifier_plugin_.find(identifier) != identifier_plugin_.end()) | 379 if (identifier_plugin_.find(identifier) != identifier_plugin_.end()) |
| 380 identifier = GetLongIdentifier(plugin); | 380 identifier = GetLongIdentifier(plugin); |
| 381 | 381 |
| 382 DCHECK(identifier_plugin_.find(identifier) == identifier_plugin_.end()); | 382 DCHECK(identifier_plugin_.find(identifier) == identifier_plugin_.end()); |
| 383 identifier_plugin_[identifier] = metadata; | 383 identifier_plugin_[identifier] = metadata; |
| 384 return metadata->Clone(); | 384 return metadata->Clone(); |
| 385 } | 385 } |
| OLD | NEW |