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 #ifndef WEBKIT_PLUGINS_NPAPI_PLUGIN_UTILS_H_ | 5 #ifndef WEBKIT_PLUGINS_NPAPI_PLUGIN_UTILS_H_ |
6 #define WEBKIT_PLUGINS_NPAPI_PLUGIN_UTILS_H_ | 6 #define WEBKIT_PLUGINS_NPAPI_PLUGIN_UTILS_H_ |
7 | 7 |
8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "ui/gfx/native_widget_types.h" |
9 | 10 |
10 namespace base { | 11 namespace base { |
11 class Version; | 12 class Version; |
12 } | 13 } |
13 | 14 |
14 namespace webkit { | 15 namespace webkit { |
15 namespace npapi { | 16 namespace npapi { |
16 | 17 |
17 // Parse a version string as used by a plug-in. This method is more lenient | 18 // Parse a version string as used by a plug-in. This method is more lenient |
18 // in accepting weird version strings than base::Version::GetFromString() | 19 // in accepting weird version strings than base::Version::GetFromString() |
19 void CreateVersionFromString( | 20 void CreateVersionFromString( |
20 const base::string16& version_string, | 21 const base::string16& version_string, |
21 base::Version* parsed_version); | 22 base::Version* parsed_version); |
22 | 23 |
23 // Returns true iff NPAPI plugins are supported on the current platform. | 24 // Returns true iff NPAPI plugins are supported on the current platform. |
24 bool NPAPIPluginsSupported(); | 25 bool NPAPIPluginsSupported(); |
25 | 26 |
26 // Tells the plugin thread to terminate the process forcefully instead of | 27 // Tells the plugin thread to terminate the process forcefully instead of |
27 // exiting cleanly. | 28 // exiting cleanly. |
28 void SetForcefullyTerminatePluginProcess(bool value); | 29 void SetForcefullyTerminatePluginProcess(bool value); |
29 | 30 |
30 // Returns true if the plugin thread should terminate the process forcefully | 31 // Returns true if the plugin thread should terminate the process forcefully |
31 // instead of exiting cleanly. | 32 // instead of exiting cleanly. |
32 bool ShouldForcefullyTerminatePluginProcess(); | 33 bool ShouldForcefullyTerminatePluginProcess(); |
33 | 34 |
| 35 #if defined(OS_WIN) |
| 36 // The window class name for a plugin window. |
| 37 extern const char16 kNativeWindowClassName[]; |
| 38 extern const char16 kPluginNameAtomProperty[]; |
| 39 extern const char16 kPluginVersionAtomProperty[]; |
| 40 extern const char16 kDummyActivationWindowName[]; |
| 41 |
| 42 bool IsPluginDelegateWindow(HWND window); |
| 43 bool GetPluginNameFromWindow(HWND window, base::string16* plugin_name); |
| 44 bool GetPluginVersionFromWindow(HWND window, base::string16* plugin_version); |
| 45 |
| 46 // Returns true if the window handle passed in is that of the dummy |
| 47 // activation window for windowless plugins. |
| 48 bool IsDummyActivationWindow(HWND window); |
| 49 |
| 50 // Returns the default HWND to parent the windowed plugins and dummy windows |
| 51 // for activation to when none isavailable. |
| 52 HWND GetDefaultWindowParent(); |
| 53 #endif |
34 | 54 |
35 } // namespace npapi | 55 } // namespace npapi |
36 } // namespace webkit | 56 } // namespace webkit |
37 | 57 |
38 #endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_UTILS_H_ | 58 #endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_UTILS_H_ |
OLD | NEW |