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/common/pepper_flash.h" |
| 6 |
5 #include <stddef.h> | 7 #include <stddef.h> |
6 | 8 |
7 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
8 #include "base/values.h" | 10 #include "base/values.h" |
9 #include "base/version.h" | 11 #include "base/version.h" |
10 #include "build/build_config.h" | 12 #include "build/build_config.h" |
11 #include "chrome/common/pepper_flash.h" | |
12 #include "chrome/common/ppapi_utils.h" | 13 #include "chrome/common/ppapi_utils.h" |
13 #include "ppapi/c/private/ppb_pdf.h" | 14 #include "ppapi/c/private/ppb_pdf.h" |
14 #include "ppapi/shared_impl/ppapi_permissions.h" | 15 #include "ppapi/shared_impl/ppapi_permissions.h" |
15 | 16 |
| 17 #if defined(OS_WIN) |
| 18 #include "base/win/registry.h" |
| 19 #endif |
| 20 |
16 namespace chrome { | 21 namespace chrome { |
17 | 22 |
18 const int32_t kPepperFlashPermissions = | 23 const int32_t kPepperFlashPermissions = |
19 ppapi::PERMISSION_DEV | ppapi::PERMISSION_PRIVATE | | 24 ppapi::PERMISSION_DEV | ppapi::PERMISSION_PRIVATE | |
20 ppapi::PERMISSION_BYPASS_USER_GESTURE | ppapi::PERMISSION_FLASH; | 25 ppapi::PERMISSION_BYPASS_USER_GESTURE | ppapi::PERMISSION_FLASH; |
21 namespace { | 26 namespace { |
22 | 27 |
23 // File name of the Pepper Flash component manifest on different platforms. | 28 // File name of the Pepper Flash component manifest on different platforms. |
24 const char kPepperFlashManifestName[] = "Flapper"; | 29 const char kPepperFlashManifestName[] = "Flapper"; |
25 | 30 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 126 |
122 std::string arch; | 127 std::string arch; |
123 manifest.GetStringASCII("x-ppapi-arch", &arch); | 128 manifest.GetStringASCII("x-ppapi-arch", &arch); |
124 if (arch != kPepperFlashArch) | 129 if (arch != kPepperFlashArch) |
125 return false; | 130 return false; |
126 | 131 |
127 *version_out = version; | 132 *version_out = version; |
128 return true; | 133 return true; |
129 } | 134 } |
130 | 135 |
| 136 bool IsSystemFlashScriptDebuggerPresent() { |
| 137 #if defined(OS_WIN) |
| 138 const wchar_t kFlashRegistryRoot[] = |
| 139 L"SOFTWARE\\Macromedia\\FlashPlayerPepper"; |
| 140 const wchar_t kIsDebuggerValueName[] = L"isScriptDebugger"; |
| 141 |
| 142 base::win::RegKey path_key(HKEY_LOCAL_MACHINE, kFlashRegistryRoot, KEY_READ); |
| 143 DWORD debug_value; |
| 144 if (path_key.ReadValueDW(kIsDebuggerValueName, &debug_value) != ERROR_SUCCESS) |
| 145 return false; |
| 146 |
| 147 return (debug_value == 1); |
| 148 #else |
| 149 // TODO(wfh): implement this on OS X and Linux. crbug.com/497996. |
| 150 return false; |
| 151 #endif |
| 152 } |
| 153 |
131 } // namespace chrome | 154 } // namespace chrome |
OLD | NEW |