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 "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 <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 #include "ppapi/c/private/ppb_pdf.h" | 38 #include "ppapi/c/private/ppb_pdf.h" |
39 #include "ppapi/shared_impl/ppapi_permissions.h" | 39 #include "ppapi/shared_impl/ppapi_permissions.h" |
40 | 40 |
41 #include "flapper_version.h" // In SHARED_INTERMEDIATE_DIR. | 41 #include "flapper_version.h" // In SHARED_INTERMEDIATE_DIR. |
42 | 42 |
43 using content::BrowserThread; | 43 using content::BrowserThread; |
44 using content::PluginService; | 44 using content::PluginService; |
45 | 45 |
46 namespace { | 46 namespace { |
47 | 47 |
| 48 // File name of the Pepper Flash component manifest on different platforms. |
| 49 const char kPepperFlashManifestName[] = "Flapper"; |
| 50 |
| 51 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_LINUX) |
48 // CRX hash. The extension id is: mimojjlkmoijpicakmndhoigimigcmbb. | 52 // CRX hash. The extension id is: mimojjlkmoijpicakmndhoigimigcmbb. |
49 const uint8 kSha2Hash[] = {0xc8, 0xce, 0x99, 0xba, 0xce, 0x89, 0xf8, 0x20, | 53 const uint8 kSha2Hash[] = {0xc8, 0xce, 0x99, 0xba, 0xce, 0x89, 0xf8, 0x20, |
50 0xac, 0xd3, 0x7e, 0x86, 0x8c, 0x86, 0x2c, 0x11, | 54 0xac, 0xd3, 0x7e, 0x86, 0x8c, 0x86, 0x2c, 0x11, |
51 0xb9, 0x40, 0xc5, 0x55, 0xaf, 0x08, 0x63, 0x70, | 55 0xb9, 0x40, 0xc5, 0x55, 0xaf, 0x08, 0x63, 0x70, |
52 0x54, 0xf9, 0x56, 0xd3, 0xe7, 0x88, 0xba, 0x8c}; | 56 0x54, 0xf9, 0x56, 0xd3, 0xe7, 0x88, 0xba, 0x8c}; |
53 | 57 |
54 // File name of the Pepper Flash component manifest on different platforms. | 58 // If we don't have a Pepper Flash component, this is the version we claim. |
55 const char kPepperFlashManifestName[] = "Flapper"; | 59 const char kNullVersion[] = "0.0.0.0"; |
| 60 |
| 61 #endif // defined(GOOGLE_CHROME_BUILD) && !defined(OS_LINUX) |
56 | 62 |
57 // Name of the Pepper Flash OS in the component manifest. | 63 // Name of the Pepper Flash OS in the component manifest. |
58 const char kPepperFlashOperatingSystem[] = | 64 const char kPepperFlashOperatingSystem[] = |
59 #if defined(OS_MACOSX) | 65 #if defined(OS_MACOSX) |
60 "mac"; | 66 "mac"; |
61 #elif defined(OS_WIN) | 67 #elif defined(OS_WIN) |
62 "win"; | 68 "win"; |
63 #else // OS_LINUX, etc. TODO(viettrungluu): Separate out Chrome OS and Android? | 69 #else // OS_LINUX, etc. TODO(viettrungluu): Separate out Chrome OS and Android? |
64 "linux"; | 70 "linux"; |
65 #endif | 71 #endif |
66 | 72 |
67 // Name of the Pepper Flash architecture in the component manifest. | 73 // Name of the Pepper Flash architecture in the component manifest. |
68 const char kPepperFlashArch[] = | 74 const char kPepperFlashArch[] = |
69 #if defined(ARCH_CPU_X86) | 75 #if defined(ARCH_CPU_X86) |
70 "ia32"; | 76 "ia32"; |
71 #elif defined(ARCH_CPU_X86_64) | 77 #elif defined(ARCH_CPU_X86_64) |
72 "x64"; | 78 "x64"; |
73 #else // TODO(viettrungluu): Support an ARM check? | 79 #else // TODO(viettrungluu): Support an ARM check? |
74 "???"; | 80 "???"; |
75 #endif | 81 #endif |
76 | 82 |
77 // If we don't have a Pepper Flash component, this is the version we claim. | |
78 const char kNullVersion[] = "0.0.0.0"; | |
79 | |
80 // The base directory on Windows looks like: | 83 // The base directory on Windows looks like: |
81 // <profile>\AppData\Local\Google\Chrome\User Data\PepperFlash\. | 84 // <profile>\AppData\Local\Google\Chrome\User Data\PepperFlash\. |
82 base::FilePath GetPepperFlashBaseDirectory() { | 85 base::FilePath GetPepperFlashBaseDirectory() { |
83 base::FilePath result; | 86 base::FilePath result; |
84 PathService::Get(chrome::DIR_COMPONENT_UPDATED_PEPPER_FLASH_PLUGIN, &result); | 87 PathService::Get(chrome::DIR_COMPONENT_UPDATED_PEPPER_FLASH_PLUGIN, &result); |
85 return result; | 88 return result; |
86 } | 89 } |
87 | 90 |
88 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_LINUX) | 91 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_LINUX) |
89 // Pepper Flash plugins have the version encoded in the path itself | 92 // Pepper Flash plugins have the version encoded in the path itself |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_LINUX) | 400 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_LINUX) |
398 // Component updated flash supersedes bundled flash therefore if that one | 401 // Component updated flash supersedes bundled flash therefore if that one |
399 // is disabled then this one should never install. | 402 // is disabled then this one should never install. |
400 CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 403 CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
401 if (cmd_line->HasSwitch(switches::kDisableBundledPpapiFlash)) | 404 if (cmd_line->HasSwitch(switches::kDisableBundledPpapiFlash)) |
402 return; | 405 return; |
403 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 406 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
404 base::Bind(&StartPepperFlashUpdateRegistration, cus)); | 407 base::Bind(&StartPepperFlashUpdateRegistration, cus)); |
405 #endif | 408 #endif |
406 } | 409 } |
OLD | NEW |