| 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/component_updater/flash_component_installer.h" | 5 #include "chrome/browser/component_updater/flash_component_installer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 } | 136 } |
| 137 } | 137 } |
| 138 | 138 |
| 139 // The code in this function is only concerned about learning what flash plugin | 139 // The code in this function is only concerned about learning what flash plugin |
| 140 // chrome is using and what is its version. This will determine if we register | 140 // chrome is using and what is its version. This will determine if we register |
| 141 // for component update or not. Read the comments on RegisterNPAPIFlashComponent | 141 // for component update or not. Read the comments on RegisterNPAPIFlashComponent |
| 142 // for more background. | 142 // for more background. |
| 143 void StartFlashUpdateRegistration(ComponentUpdateService* cus, | 143 void StartFlashUpdateRegistration(ComponentUpdateService* cus, |
| 144 const std::vector<webkit::WebPluginInfo>&) { | 144 const std::vector<webkit::WebPluginInfo>&) { |
| 145 FilePath builtin_plugin_path; | 145 FilePath builtin_plugin_path; |
| 146 if (!PathService::Get(chrome::FILE_FLASH_PLUGIN, &builtin_plugin_path)) | 146 if (!PathService::Get(chrome::FILE_FLASH_PLUGIN_EXISTING, |
| 147 &builtin_plugin_path)) |
| 147 return; | 148 return; |
| 148 | 149 |
| 149 FilePath updated_plugin_path = | 150 FilePath updated_plugin_path = |
| 150 GetNPAPIFlashBaseDirectory().Append(kFlashPluginFileName); | 151 GetNPAPIFlashBaseDirectory().Append(kFlashPluginFileName); |
| 151 | 152 |
| 152 PluginService* plugins = PluginService::GetInstance(); | 153 PluginService* plugins = PluginService::GetInstance(); |
| 153 webkit::WebPluginInfo plugin_info; | 154 webkit::WebPluginInfo plugin_info; |
| 154 | 155 |
| 155 if (plugins->GetPluginInfoByPath(updated_plugin_path, &plugin_info)) { | 156 if (plugins->GetPluginInfoByPath(updated_plugin_path, &plugin_info)) { |
| 156 // The updated plugin is newer. Since flash is used by pretty much every | 157 // The updated plugin is newer. Since flash is used by pretty much every |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 // are loaded. | 215 // are loaded. |
| 215 BrowserThread::PostDelayedTask( | 216 BrowserThread::PostDelayedTask( |
| 216 BrowserThread::FILE, | 217 BrowserThread::FILE, |
| 217 FROM_HERE, | 218 FROM_HERE, |
| 218 base::Bind(&PluginService::GetPlugins, | 219 base::Bind(&PluginService::GetPlugins, |
| 219 base::Unretained(PluginService::GetInstance()), | 220 base::Unretained(PluginService::GetInstance()), |
| 220 base::Bind(&StartFlashUpdateRegistration, cus)), | 221 base::Bind(&StartFlashUpdateRegistration, cus)), |
| 221 base::TimeDelta::FromSeconds(8)); | 222 base::TimeDelta::FromSeconds(8)); |
| 222 #endif | 223 #endif |
| 223 } | 224 } |
| OLD | NEW |