| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 return new PluginDataRemoverImpl(browser_context); | 41 return new PluginDataRemoverImpl(browser_context); |
| 42 } | 42 } |
| 43 | 43 |
| 44 // static | 44 // static |
| 45 void PluginDataRemover::GetSupportedPlugins( | 45 void PluginDataRemover::GetSupportedPlugins( |
| 46 std::vector<WebPluginInfo>* supported_plugins) { | 46 std::vector<WebPluginInfo>* supported_plugins) { |
| 47 bool allow_wildcard = false; | 47 bool allow_wildcard = false; |
| 48 std::vector<WebPluginInfo> plugins; | 48 std::vector<WebPluginInfo> plugins; |
| 49 PluginService::GetInstance()->GetPluginInfoArray( | 49 PluginService::GetInstance()->GetPluginInfoArray( |
| 50 GURL(), kFlashPluginSwfMimeType, allow_wildcard, &plugins, NULL); | 50 GURL(), kFlashPluginSwfMimeType, allow_wildcard, &plugins, NULL); |
| 51 Version min_version(kMinFlashVersion); | 51 base::Version min_version(kMinFlashVersion); |
| 52 for (std::vector<WebPluginInfo>::iterator it = plugins.begin(); | 52 for (std::vector<WebPluginInfo>::iterator it = plugins.begin(); |
| 53 it != plugins.end(); ++it) { | 53 it != plugins.end(); ++it) { |
| 54 Version version; | 54 base::Version version; |
| 55 WebPluginInfo::CreateVersionFromString(it->version, &version); | 55 WebPluginInfo::CreateVersionFromString(it->version, &version); |
| 56 if (version.IsValid() && min_version.CompareTo(version) == -1) | 56 if (version.IsValid() && min_version.CompareTo(version) == -1) |
| 57 supported_plugins->push_back(*it); | 57 supported_plugins->push_back(*it); |
| 58 } | 58 } |
| 59 } | 59 } |
| 60 | 60 |
| 61 class PluginDataRemoverImpl::Context | 61 class PluginDataRemoverImpl::Context |
| 62 : public PpapiPluginProcessHost::BrokerClient, | 62 : public PpapiPluginProcessHost::BrokerClient, |
| 63 public IPC::Listener, | 63 public IPC::Listener, |
| 64 public base::RefCountedThreadSafe<Context, | 64 public base::RefCountedThreadSafe<Context, |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 | 266 |
| 267 base::WaitableEvent* PluginDataRemoverImpl::StartRemoving( | 267 base::WaitableEvent* PluginDataRemoverImpl::StartRemoving( |
| 268 base::Time begin_time) { | 268 base::Time begin_time) { |
| 269 DCHECK(!context_.get()); | 269 DCHECK(!context_.get()); |
| 270 context_ = new Context(begin_time, browser_context_); | 270 context_ = new Context(begin_time, browser_context_); |
| 271 context_->Init(mime_type_); | 271 context_->Init(mime_type_); |
| 272 return context_->event(); | 272 return context_->event(); |
| 273 } | 273 } |
| 274 | 274 |
| 275 } // namespace content | 275 } // namespace content |
| OLD | NEW |