| 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_metadata.h" | 5 #include "chrome/browser/plugins/plugin_metadata.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/pattern.h" |
| 10 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 11 #include "content/public/common/webplugininfo.h" | 12 #include "content/public/common/webplugininfo.h" |
| 12 | 13 |
| 13 // static | 14 // static |
| 14 const char PluginMetadata::kAdobeReaderGroupName[] = "Adobe Reader"; | 15 const char PluginMetadata::kAdobeReaderGroupName[] = "Adobe Reader"; |
| 15 const char PluginMetadata::kJavaGroupName[] = "Java(TM)"; | 16 const char PluginMetadata::kJavaGroupName[] = "Java(TM)"; |
| 16 const char PluginMetadata::kQuickTimeGroupName[] = "QuickTime Player"; | 17 const char PluginMetadata::kQuickTimeGroupName[] = "QuickTime Player"; |
| 17 const char PluginMetadata::kShockwaveGroupName[] = "Adobe Shockwave Player"; | 18 const char PluginMetadata::kShockwaveGroupName[] = "Adobe Shockwave Player"; |
| 18 const char PluginMetadata::kRealPlayerGroupName[] = "RealPlayer"; | 19 const char PluginMetadata::kRealPlayerGroupName[] = "RealPlayer"; |
| 19 const char PluginMetadata::kSilverlightGroupName[] = "Silverlight"; | 20 const char PluginMetadata::kSilverlightGroupName[] = "Silverlight"; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // must be handled by the plugin. | 67 // must be handled by the plugin. |
| 67 size_t j = 0; | 68 size_t j = 0; |
| 68 for (; j < plugin.mime_types.size(); ++j) { | 69 for (; j < plugin.mime_types.size(); ++j) { |
| 69 if (plugin.mime_types[j].mime_type == matching_mime_types_[i]) | 70 if (plugin.mime_types[j].mime_type == matching_mime_types_[i]) |
| 70 break; | 71 break; |
| 71 } | 72 } |
| 72 if (j == plugin.mime_types.size()) | 73 if (j == plugin.mime_types.size()) |
| 73 return false; | 74 return false; |
| 74 } | 75 } |
| 75 | 76 |
| 76 return MatchPattern(plugin.name, group_name_matcher_); | 77 return base::MatchPattern(plugin.name, group_name_matcher_); |
| 77 } | 78 } |
| 78 | 79 |
| 79 // static | 80 // static |
| 80 bool PluginMetadata::ParseSecurityStatus( | 81 bool PluginMetadata::ParseSecurityStatus( |
| 81 const std::string& status_str, | 82 const std::string& status_str, |
| 82 PluginMetadata::SecurityStatus* status) { | 83 PluginMetadata::SecurityStatus* status) { |
| 83 if (status_str == "up_to_date") | 84 if (status_str == "up_to_date") |
| 84 *status = SECURITY_STATUS_UP_TO_DATE; | 85 *status = SECURITY_STATUS_UP_TO_DATE; |
| 85 else if (status_str == "out_of_date") | 86 else if (status_str == "out_of_date") |
| 86 *status = SECURITY_STATUS_OUT_OF_DATE; | 87 *status = SECURITY_STATUS_OUT_OF_DATE; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 PluginMetadata* copy = new PluginMetadata(identifier_, | 126 PluginMetadata* copy = new PluginMetadata(identifier_, |
| 126 name_, | 127 name_, |
| 127 url_for_display_, | 128 url_for_display_, |
| 128 plugin_url_, | 129 plugin_url_, |
| 129 help_url_, | 130 help_url_, |
| 130 group_name_matcher_, | 131 group_name_matcher_, |
| 131 language_); | 132 language_); |
| 132 copy->versions_ = versions_; | 133 copy->versions_ = versions_; |
| 133 return make_scoped_ptr(copy); | 134 return make_scoped_ptr(copy); |
| 134 } | 135 } |
| OLD | NEW |