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/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 return true; | 90 return true; |
91 } | 91 } |
92 | 92 |
93 PluginMetadata::SecurityStatus PluginMetadata::GetSecurityStatus( | 93 PluginMetadata::SecurityStatus PluginMetadata::GetSecurityStatus( |
94 const content::WebPluginInfo& plugin) const { | 94 const content::WebPluginInfo& plugin) const { |
95 if (versions_.empty()) { | 95 if (versions_.empty()) { |
96 #if defined(OS_LINUX) | 96 #if defined(OS_LINUX) |
97 // On Linux, unknown plugins require authorization. | 97 // On Linux, unknown plugins require authorization. |
98 return SECURITY_STATUS_REQUIRES_AUTHORIZATION; | 98 return SECURITY_STATUS_REQUIRES_AUTHORIZATION; |
99 #else | 99 #else |
100 if (plugin.type == content::WebPluginInfo::PLUGIN_TYPE_NPAPI) { | |
Bernhard Bauer
2013/09/24 18:16:56
This check isn't necessary. Pepper plug-ins are al
Cris Neckar
2013/09/24 18:52:00
Done.
| |
101 // Unknown NPAPI plugins require authorization. | |
102 return SECURITY_STATUS_REQUIRES_AUTHORIZATION; | |
103 } | |
100 return SECURITY_STATUS_UP_TO_DATE; | 104 return SECURITY_STATUS_UP_TO_DATE; |
101 #endif | 105 #endif |
102 } | 106 } |
103 | 107 |
104 Version version; | 108 Version version; |
105 content::WebPluginInfo::CreateVersionFromString(plugin.version, &version); | 109 content::WebPluginInfo::CreateVersionFromString(plugin.version, &version); |
106 if (!version.IsValid()) | 110 if (!version.IsValid()) |
107 version = Version("0"); | 111 version = Version("0"); |
108 | 112 |
109 // |lower_bound| returns the latest version that is not newer than |version|. | 113 // |lower_bound| returns the latest version that is not newer than |version|. |
(...skipping 17 matching lines...) Expand all Loading... | |
127 PluginMetadata* copy = new PluginMetadata(identifier_, | 131 PluginMetadata* copy = new PluginMetadata(identifier_, |
128 name_, | 132 name_, |
129 url_for_display_, | 133 url_for_display_, |
130 plugin_url_, | 134 plugin_url_, |
131 help_url_, | 135 help_url_, |
132 group_name_matcher_, | 136 group_name_matcher_, |
133 language_); | 137 language_); |
134 copy->versions_ = versions_; | 138 copy->versions_ = versions_; |
135 return make_scoped_ptr(copy); | 139 return make_scoped_ptr(copy); |
136 } | 140 } |
OLD | NEW |