OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/plugin_data_remover.h" | 5 #include "chrome/browser/plugin_data_remover.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/message_loop_proxy.h" | 8 #include "base/message_loop_proxy.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 if (!is_removing_) | 161 if (!is_removing_) |
162 return; | 162 return; |
163 is_removing_ = false; | 163 is_removing_ = false; |
164 event_->Signal(); | 164 event_->Signal(); |
165 } | 165 } |
166 | 166 |
167 // static | 167 // static |
168 bool PluginDataRemover::IsSupported() { | 168 bool PluginDataRemover::IsSupported() { |
169 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 169 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
170 bool allow_wildcard = false; | 170 bool allow_wildcard = false; |
171 webkit::npapi::WebPluginInfo plugin; | 171 std::vector<webkit::npapi::WebPluginInfo> plugins; |
172 std::string mime_type; | 172 webkit::npapi::PluginList::Singleton()->GetPluginInfoArray( |
173 if (!webkit::npapi::PluginList::Singleton()->GetPluginInfo( | 173 GURL(), kFlashMimeType, allow_wildcard, NULL, &plugins, NULL); |
174 GURL(), kFlashMimeType, allow_wildcard, &plugin, &mime_type)) { | 174 std::vector<webkit::npapi::WebPluginInfo>::iterator plugin = plugins.begin(); |
| 175 if (plugin == plugins.end()) |
175 return false; | 176 return false; |
176 } | |
177 scoped_ptr<Version> version( | 177 scoped_ptr<Version> version( |
178 webkit::npapi::PluginGroup::CreateVersionFromString(plugin.version)); | 178 webkit::npapi::PluginGroup::CreateVersionFromString(plugin->version)); |
179 scoped_ptr<Version> min_version(Version::GetVersionFromString( | 179 scoped_ptr<Version> min_version(Version::GetVersionFromString( |
180 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 180 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
181 switches::kMinClearSiteDataFlashVersion))); | 181 switches::kMinClearSiteDataFlashVersion))); |
182 if (!min_version.get()) | 182 if (!min_version.get()) |
183 min_version.reset(Version::GetVersionFromString(kMinFlashVersion)); | 183 min_version.reset(Version::GetVersionFromString(kMinFlashVersion)); |
184 return webkit::npapi::IsPluginEnabled(plugin) && | 184 return webkit::npapi::IsPluginEnabled(*plugin) && |
185 version.get() && | 185 version.get() && |
186 min_version->CompareTo(*version) == -1; | 186 min_version->CompareTo(*version) == -1; |
187 } | 187 } |
OLD | NEW |