| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <stdint.h> |
| 5 #include <string.h> | 6 #include <string.h> |
| 6 | |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/files/file_enumerator.h" | 13 #include "base/files/file_enumerator.h" |
| 14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 15 #include "base/files/file_util.h" | 15 #include "base/files/file_util.h" |
| 16 #include "base/logging.h" | 16 #include "base/logging.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 43 | 43 |
| 44 namespace component_updater { | 44 namespace component_updater { |
| 45 | 45 |
| 46 namespace { | 46 namespace { |
| 47 | 47 |
| 48 // File name of the Pepper Flash component manifest on different platforms. | 48 // File name of the Pepper Flash component manifest on different platforms. |
| 49 const char kPepperFlashManifestName[] = "Flapper"; | 49 const char kPepperFlashManifestName[] = "Flapper"; |
| 50 | 50 |
| 51 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_LINUX) | 51 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_LINUX) |
| 52 // CRX hash. The extension id is: mimojjlkmoijpicakmndhoigimigcmbb. | 52 // CRX hash. The extension id is: mimojjlkmoijpicakmndhoigimigcmbb. |
| 53 const uint8 kSha2Hash[] = {0xc8, 0xce, 0x99, 0xba, 0xce, 0x89, 0xf8, 0x20, | 53 const uint8_t kSha2Hash[] = {0xc8, 0xce, 0x99, 0xba, 0xce, 0x89, 0xf8, 0x20, |
| 54 0xac, 0xd3, 0x7e, 0x86, 0x8c, 0x86, 0x2c, 0x11, | 54 0xac, 0xd3, 0x7e, 0x86, 0x8c, 0x86, 0x2c, 0x11, |
| 55 0xb9, 0x40, 0xc5, 0x55, 0xaf, 0x08, 0x63, 0x70, | 55 0xb9, 0x40, 0xc5, 0x55, 0xaf, 0x08, 0x63, 0x70, |
| 56 0x54, 0xf9, 0x56, 0xd3, 0xe7, 0x88, 0xba, 0x8c}; | 56 0x54, 0xf9, 0x56, 0xd3, 0xe7, 0x88, 0xba, 0x8c}; |
| 57 | 57 |
| 58 // If we don't have a Pepper Flash component, this is the version we claim. | 58 // If we don't have a Pepper Flash component, this is the version we claim. |
| 59 const char kNullVersion[] = "0.0.0.0"; | 59 const char kNullVersion[] = "0.0.0.0"; |
| 60 | 60 |
| 61 #endif // defined(GOOGLE_CHROME_BUILD) && !defined(OS_LINUX) | 61 #endif // defined(GOOGLE_CHROME_BUILD) && !defined(OS_LINUX) |
| 62 | 62 |
| 63 // Name of the Pepper Flash OS in the component manifest. | 63 // Name of the Pepper Flash OS in the component manifest. |
| 64 const char kPepperFlashOperatingSystem[] = | 64 const char kPepperFlashOperatingSystem[] = |
| 65 #if defined(OS_MACOSX) | 65 #if defined(OS_MACOSX) |
| 66 "mac"; | 66 "mac"; |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 return (strcmp(interface_name, PPB_PDF_INTERFACE) == 0); | 208 return (strcmp(interface_name, PPB_PDF_INTERFACE) == 0); |
| 209 } | 209 } |
| 210 | 210 |
| 211 bool MakePepperFlashPluginInfo(const base::FilePath& flash_path, | 211 bool MakePepperFlashPluginInfo(const base::FilePath& flash_path, |
| 212 const Version& flash_version, | 212 const Version& flash_version, |
| 213 bool out_of_process, | 213 bool out_of_process, |
| 214 bool is_debugger, | 214 bool is_debugger, |
| 215 content::PepperPluginInfo* plugin_info) { | 215 content::PepperPluginInfo* plugin_info) { |
| 216 if (!flash_version.IsValid()) | 216 if (!flash_version.IsValid()) |
| 217 return false; | 217 return false; |
| 218 const std::vector<uint16> ver_nums = flash_version.components(); | 218 const std::vector<uint16_t> ver_nums = flash_version.components(); |
| 219 if (ver_nums.size() < 3) | 219 if (ver_nums.size() < 3) |
| 220 return false; | 220 return false; |
| 221 | 221 |
| 222 plugin_info->is_internal = false; | 222 plugin_info->is_internal = false; |
| 223 plugin_info->is_out_of_process = out_of_process; | 223 plugin_info->is_out_of_process = out_of_process; |
| 224 plugin_info->path = flash_path; | 224 plugin_info->path = flash_path; |
| 225 plugin_info->name = content::kFlashPluginName; | 225 plugin_info->name = content::kFlashPluginName; |
| 226 plugin_info->permissions = kPepperFlashPermissions; | 226 plugin_info->permissions = kPepperFlashPermissions; |
| 227 | 227 |
| 228 // The description is like "Shockwave Flash 10.2 r154". | 228 // The description is like "Shockwave Flash 10.2 r154". |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 507 CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
| 508 if (cmd_line->HasSwitch(switches::kDisableBundledPpapiFlash)) | 508 if (cmd_line->HasSwitch(switches::kDisableBundledPpapiFlash)) |
| 509 return; | 509 return; |
| 510 BrowserThread::PostTask(BrowserThread::FILE, | 510 BrowserThread::PostTask(BrowserThread::FILE, |
| 511 FROM_HERE, | 511 FROM_HERE, |
| 512 base::Bind(&StartPepperFlashUpdateRegistration, cus)); | 512 base::Bind(&StartPepperFlashUpdateRegistration, cus)); |
| 513 #endif | 513 #endif |
| 514 } | 514 } |
| 515 | 515 |
| 516 } // namespace component_updater | 516 } // namespace component_updater |
| OLD | NEW |