| 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 "content/child/npapi/webplugin_delegate_impl.h" | 5 #include "content/child/npapi/webplugin_delegate_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "skia/ext/platform_canvas.h" | 31 #include "skia/ext/platform_canvas.h" |
| 32 #include "third_party/WebKit/public/web/WebInputEvent.h" | 32 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 33 #include "ui/base/win/dpi.h" | 33 #include "ui/base/win/dpi.h" |
| 34 #include "ui/base/win/hwnd_util.h" | 34 #include "ui/base/win/hwnd_util.h" |
| 35 #include "webkit/common/cursors/webcursor.h" | 35 #include "webkit/common/cursors/webcursor.h" |
| 36 #include "webkit/plugins/plugin_constants.h" | 36 #include "webkit/plugins/plugin_constants.h" |
| 37 | 37 |
| 38 using WebKit::WebKeyboardEvent; | 38 using WebKit::WebKeyboardEvent; |
| 39 using WebKit::WebInputEvent; | 39 using WebKit::WebInputEvent; |
| 40 using WebKit::WebMouseEvent; | 40 using WebKit::WebMouseEvent; |
| 41 using webkit::WebPluginInfo; | |
| 42 | 41 |
| 43 namespace content { | 42 namespace content { |
| 44 | 43 |
| 45 namespace { | 44 namespace { |
| 46 | 45 |
| 47 const wchar_t kWebPluginDelegateProperty[] = L"WebPluginDelegateProperty"; | 46 const wchar_t kWebPluginDelegateProperty[] = L"WebPluginDelegateProperty"; |
| 48 const wchar_t kPluginFlashThrottle[] = L"FlashThrottle"; | 47 const wchar_t kPluginFlashThrottle[] = L"FlashThrottle"; |
| 49 | 48 |
| 50 // The fastest we are willing to process WM_USER+1 events for Flash. | 49 // The fastest we are willing to process WM_USER+1 events for Flash. |
| 51 // Flash can easily exceed the limits of our CPU if we don't throttle it. | 50 // Flash can easily exceed the limits of our CPU if we don't throttle it. |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 if (result != STATUS_SUCCESS) | 180 if (result != STATUS_SUCCESS) |
| 182 return L""; | 181 return L""; |
| 183 | 182 |
| 184 KEY_NAME_INFORMATION* info = | 183 KEY_NAME_INFORMATION* info = |
| 185 reinterpret_cast<KEY_NAME_INFORMATION*>(buffer.get()); | 184 reinterpret_cast<KEY_NAME_INFORMATION*>(buffer.get()); |
| 186 return std::wstring(info->Name, info->NameLength / sizeof(wchar_t)); | 185 return std::wstring(info->Name, info->NameLength / sizeof(wchar_t)); |
| 187 } | 186 } |
| 188 | 187 |
| 189 int GetPluginMajorVersion(const WebPluginInfo& plugin_info) { | 188 int GetPluginMajorVersion(const WebPluginInfo& plugin_info) { |
| 190 Version plugin_version; | 189 Version plugin_version; |
| 191 webkit::WebPluginInfo::CreateVersionFromString( | 190 WebPluginInfo::CreateVersionFromString(plugin_info.version, &plugin_version); |
| 192 plugin_info.version, &plugin_version); | |
| 193 | 191 |
| 194 int major_version = 0; | 192 int major_version = 0; |
| 195 if (plugin_version.IsValid()) | 193 if (plugin_version.IsValid()) |
| 196 major_version = plugin_version.components()[0]; | 194 major_version = plugin_version.components()[0]; |
| 197 | 195 |
| 198 return major_version; | 196 return major_version; |
| 199 } | 197 } |
| 200 | 198 |
| 201 } // namespace | 199 } // namespace |
| 202 | 200 |
| (...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1482 case WM_RBUTTONUP: | 1480 case WM_RBUTTONUP: |
| 1483 ::ReleaseCapture(); | 1481 ::ReleaseCapture(); |
| 1484 break; | 1482 break; |
| 1485 | 1483 |
| 1486 default: | 1484 default: |
| 1487 break; | 1485 break; |
| 1488 } | 1486 } |
| 1489 } | 1487 } |
| 1490 | 1488 |
| 1491 } // namespace content | 1489 } // namespace content |
| OLD | NEW |