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/prefs/pref_registry_simple.h" | 10 #include "base/prefs/pref_registry_simple.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 std::string version; | 112 std::string version; |
113 success = version_dict->GetString("version", &version); | 113 success = version_dict->GetString("version", &version); |
114 DCHECK(success); | 114 DCHECK(success); |
115 std::string status_str; | 115 std::string status_str; |
116 success = version_dict->GetString("status", &status_str); | 116 success = version_dict->GetString("status", &status_str); |
117 DCHECK(success); | 117 DCHECK(success); |
118 PluginMetadata::SecurityStatus status = | 118 PluginMetadata::SecurityStatus status = |
119 PluginMetadata::SECURITY_STATUS_UP_TO_DATE; | 119 PluginMetadata::SECURITY_STATUS_UP_TO_DATE; |
120 success = PluginMetadata::ParseSecurityStatus(status_str, &status); | 120 success = PluginMetadata::ParseSecurityStatus(status_str, &status); |
121 DCHECK(success); | 121 DCHECK(success); |
122 plugin->AddVersion(base::Version(version), status); | 122 plugin->AddVersion(Version(version), status); |
123 } | 123 } |
124 } | 124 } |
125 | 125 |
126 LoadMimeTypes(false, plugin_dict, plugin); | 126 LoadMimeTypes(false, plugin_dict, plugin); |
127 LoadMimeTypes(true, plugin_dict, plugin); | 127 LoadMimeTypes(true, plugin_dict, plugin); |
128 return plugin; | 128 return plugin; |
129 } | 129 } |
130 | 130 |
131 } // namespace | 131 } // namespace |
132 | 132 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 metadata->AddMatchingMimeType(plugin.mime_types[i].mime_type); | 295 metadata->AddMatchingMimeType(plugin.mime_types[i].mime_type); |
296 | 296 |
297 DCHECK(metadata->MatchesPlugin(plugin)); | 297 DCHECK(metadata->MatchesPlugin(plugin)); |
298 if (identifier_plugin_.find(identifier) != identifier_plugin_.end()) | 298 if (identifier_plugin_.find(identifier) != identifier_plugin_.end()) |
299 identifier = GetLongIdentifier(plugin); | 299 identifier = GetLongIdentifier(plugin); |
300 | 300 |
301 DCHECK(identifier_plugin_.find(identifier) == identifier_plugin_.end()); | 301 DCHECK(identifier_plugin_.find(identifier) == identifier_plugin_.end()); |
302 identifier_plugin_[identifier] = metadata; | 302 identifier_plugin_[identifier] = metadata; |
303 return metadata->Clone(); | 303 return metadata->Clone(); |
304 } | 304 } |
OLD | NEW |