| 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/component_updater/flash_component_installer.h" | 5 #include "chrome/browser/component_updater/flash_component_installer.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
| 16 #include "base/stringprintf.h" | 16 #include "base/stringprintf.h" |
| 17 #include "base/values.h" | 17 #include "base/values.h" |
| 18 #include "base/version.h" | 18 #include "base/version.h" |
| 19 #include "build/build_config.h" | 19 #include "build/build_config.h" |
| 20 #include "chrome/browser/component_updater/component_updater_service.h" | 20 #include "chrome/browser/component_updater/component_updater_service.h" |
| 21 #include "chrome/browser/plugin_prefs.h" | 21 #include "chrome/browser/plugin_prefs.h" |
| 22 #include "chrome/common/chrome_paths.h" | 22 #include "chrome/common/chrome_paths.h" |
| 23 #include "content/browser/plugin_service.h" |
| 23 #include "content/public/browser/browser_thread.h" | 24 #include "content/public/browser/browser_thread.h" |
| 24 #include "content/public/common/pepper_plugin_info.h" | 25 #include "content/public/common/pepper_plugin_info.h" |
| 25 #include "ppapi/c/private/ppb_pdf.h" | 26 #include "ppapi/c/private/ppb_pdf.h" |
| 26 #include "webkit/plugins/npapi/plugin_list.h" | |
| 27 #include "webkit/plugins/plugin_constants.h" | 27 #include "webkit/plugins/plugin_constants.h" |
| 28 #include "webkit/plugins/ppapi/plugin_module.h" | 28 #include "webkit/plugins/ppapi/plugin_module.h" |
| 29 | 29 |
| 30 using content::BrowserThread; | 30 using content::BrowserThread; |
| 31 | 31 |
| 32 namespace { | 32 namespace { |
| 33 | 33 |
| 34 // CRX hash. The extension id is: mimojjlkmoijpicakmndhoigimigcmbb. | 34 // CRX hash. The extension id is: mimojjlkmoijpicakmndhoigimigcmbb. |
| 35 const uint8 sha2_hash[] = {0xc8, 0xce, 0x99, 0xba, 0xce, 0x89, 0xf8, 0x20, | 35 const uint8 sha2_hash[] = {0xc8, 0xce, 0x99, 0xba, 0xce, 0x89, 0xf8, 0x20, |
| 36 0xac, 0xd3, 0x7e, 0x86, 0x8c, 0x86, 0x2c, 0x11, | 36 0xac, 0xd3, 0x7e, 0x86, 0x8c, 0x86, 0x2c, 0x11, |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 } | 160 } |
| 161 | 161 |
| 162 void RegisterPepperFlashWithChrome(const FilePath& path, | 162 void RegisterPepperFlashWithChrome(const FilePath& path, |
| 163 const Version& version) { | 163 const Version& version) { |
| 164 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 164 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 165 content::PepperPluginInfo plugin_info; | 165 content::PepperPluginInfo plugin_info; |
| 166 // Register it as out-of-process and disabled. | 166 // Register it as out-of-process and disabled. |
| 167 if (!MakePepperFlashPluginInfo(path, version, true, &plugin_info)) | 167 if (!MakePepperFlashPluginInfo(path, version, true, &plugin_info)) |
| 168 return; | 168 return; |
| 169 PluginPrefs::EnablePluginGlobally(kEnablePepperFlash, plugin_info.path); | 169 PluginPrefs::EnablePluginGlobally(kEnablePepperFlash, plugin_info.path); |
| 170 webkit::npapi::PluginList::Singleton()->RegisterInternalPlugin( | 170 PluginService::GetInstance()->RegisterInternalPlugin( |
| 171 plugin_info.ToWebPluginInfo()); | 171 plugin_info.ToWebPluginInfo()); |
| 172 webkit::npapi::PluginList::Singleton()->RefreshPlugins(); | 172 PluginService::GetInstance()->RefreshPlugins(); |
| 173 } | 173 } |
| 174 | 174 |
| 175 } // namespace | 175 } // namespace |
| 176 | 176 |
| 177 class PepperFlashComponentInstaller : public ComponentInstaller { | 177 class PepperFlashComponentInstaller : public ComponentInstaller { |
| 178 public: | 178 public: |
| 179 explicit PepperFlashComponentInstaller(const Version& version); | 179 explicit PepperFlashComponentInstaller(const Version& version); |
| 180 | 180 |
| 181 virtual ~PepperFlashComponentInstaller() {} | 181 virtual ~PepperFlashComponentInstaller() {} |
| 182 | 182 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 } | 314 } |
| 315 } | 315 } |
| 316 | 316 |
| 317 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 317 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
| 318 NewRunnableFunction(&FinishPepperFlashUpdateRegistration, cus, version)); | 318 NewRunnableFunction(&FinishPepperFlashUpdateRegistration, cus, version)); |
| 319 } | 319 } |
| 320 | 320 |
| 321 } // namespace | 321 } // namespace |
| 322 | 322 |
| 323 void RegisterPepperFlashComponent(ComponentUpdateService* cus) { | 323 void RegisterPepperFlashComponent(ComponentUpdateService* cus) { |
| 324 //#if defined(GOOGLE_CHROME_BUILD) | 324 // #if defined(GOOGLE_CHROME_BUILD) |
| 325 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 325 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
| 326 NewRunnableFunction(&StartPepperFlashUpdateRegistration, cus)); | 326 NewRunnableFunction(&StartPepperFlashUpdateRegistration, cus)); |
| 327 //#endif | 327 // #endif |
| 328 } | 328 } |
| OLD | NEW |