| 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 "content/browser/plugin_data_remover_impl.h" | 5 #include "content/browser/plugin_data_remover_impl.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 return new PluginDataRemoverImpl(browser_context); | 39 return new PluginDataRemoverImpl(browser_context); |
| 40 } | 40 } |
| 41 | 41 |
| 42 // static | 42 // static |
| 43 void PluginDataRemover::GetSupportedPlugins( | 43 void PluginDataRemover::GetSupportedPlugins( |
| 44 std::vector<WebPluginInfo>* supported_plugins) { | 44 std::vector<WebPluginInfo>* supported_plugins) { |
| 45 bool allow_wildcard = false; | 45 bool allow_wildcard = false; |
| 46 std::vector<WebPluginInfo> plugins; | 46 std::vector<WebPluginInfo> plugins; |
| 47 PluginService::GetInstance()->GetPluginInfoArray( | 47 PluginService::GetInstance()->GetPluginInfoArray( |
| 48 GURL(), kFlashPluginSwfMimeType, allow_wildcard, &plugins, NULL); | 48 GURL(), kFlashPluginSwfMimeType, allow_wildcard, &plugins, NULL); |
| 49 base::Version min_version(kMinFlashVersion); | 49 Version min_version(kMinFlashVersion); |
| 50 for (std::vector<WebPluginInfo>::iterator it = plugins.begin(); | 50 for (std::vector<WebPluginInfo>::iterator it = plugins.begin(); |
| 51 it != plugins.end(); ++it) { | 51 it != plugins.end(); ++it) { |
| 52 base::Version version; | 52 Version version; |
| 53 WebPluginInfo::CreateVersionFromString(it->version, &version); | 53 WebPluginInfo::CreateVersionFromString(it->version, &version); |
| 54 if (version.IsValid() && min_version.CompareTo(version) == -1) | 54 if (version.IsValid() && min_version.CompareTo(version) == -1) |
| 55 supported_plugins->push_back(*it); | 55 supported_plugins->push_back(*it); |
| 56 } | 56 } |
| 57 } | 57 } |
| 58 | 58 |
| 59 class PluginDataRemoverImpl::Context | 59 class PluginDataRemoverImpl::Context |
| 60 : public PluginProcessHost::Client, | 60 : public PluginProcessHost::Client, |
| 61 public PpapiPluginProcessHost::BrokerClient, | 61 public PpapiPluginProcessHost::BrokerClient, |
| 62 public IPC::Listener, | 62 public IPC::Listener, |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 | 309 |
| 310 base::WaitableEvent* PluginDataRemoverImpl::StartRemoving( | 310 base::WaitableEvent* PluginDataRemoverImpl::StartRemoving( |
| 311 base::Time begin_time) { | 311 base::Time begin_time) { |
| 312 DCHECK(!context_.get()); | 312 DCHECK(!context_.get()); |
| 313 context_ = new Context(begin_time, browser_context_); | 313 context_ = new Context(begin_time, browser_context_); |
| 314 context_->Init(mime_type_); | 314 context_->Init(mime_type_); |
| 315 return context_->event(); | 315 return context_->event(); |
| 316 } | 316 } |
| 317 | 317 |
| 318 } // namespace content | 318 } // namespace content |
| OLD | NEW |