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 "webkit/plugins/npapi/webplugin_delegate_impl.h" | 5 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 result = func(key, KeyNameInformation, buffer.get(), size, &size); | 248 result = func(key, KeyNameInformation, buffer.get(), size, &size); |
249 if (result != STATUS_SUCCESS) | 249 if (result != STATUS_SUCCESS) |
250 return L""; | 250 return L""; |
251 | 251 |
252 KEY_NAME_INFORMATION* info = | 252 KEY_NAME_INFORMATION* info = |
253 reinterpret_cast<KEY_NAME_INFORMATION*>(buffer.get()); | 253 reinterpret_cast<KEY_NAME_INFORMATION*>(buffer.get()); |
254 return std::wstring(info->Name, info->NameLength / sizeof(wchar_t)); | 254 return std::wstring(info->Name, info->NameLength / sizeof(wchar_t)); |
255 } | 255 } |
256 | 256 |
257 int GetPluginMajorVersion(const WebPluginInfo& plugin_info) { | 257 int GetPluginMajorVersion(const WebPluginInfo& plugin_info) { |
258 scoped_ptr<Version> plugin_version(PluginGroup::CreateVersionFromString( | 258 Version plugin_version; |
259 plugin_info.version)); | 259 PluginGroup::CreateVersionFromString(plugin_info.version, &plugin_version); |
| 260 |
260 int major_version = 0; | 261 int major_version = 0; |
261 if (plugin_version.get()) { | 262 if (plugin_version.IsValid()) |
262 major_version = plugin_version->components()[0]; | 263 major_version = plugin_version.components()[0]; |
263 } | 264 |
264 return major_version; | 265 return major_version; |
265 } | 266 } |
266 | 267 |
267 bool GetPluginPropertyFromWindow( | 268 bool GetPluginPropertyFromWindow( |
268 HWND window, const wchar_t* plugin_atom_property, | 269 HWND window, const wchar_t* plugin_atom_property, |
269 string16* plugin_property) { | 270 string16* plugin_property) { |
270 ATOM plugin_atom = reinterpret_cast<ATOM>( | 271 ATOM plugin_atom = reinterpret_cast<ATOM>( |
271 GetPropW(window, plugin_atom_property)); | 272 GetPropW(window, plugin_atom_property)); |
272 if (plugin_atom != 0) { | 273 if (plugin_atom != 0) { |
273 WCHAR plugin_property_local[MAX_PATH] = {0}; | 274 WCHAR plugin_property_local[MAX_PATH] = {0}; |
(...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1697 ::ReleaseCapture(); | 1698 ::ReleaseCapture(); |
1698 break; | 1699 break; |
1699 | 1700 |
1700 default: | 1701 default: |
1701 break; | 1702 break; |
1702 } | 1703 } |
1703 } | 1704 } |
1704 | 1705 |
1705 } // namespace npapi | 1706 } // namespace npapi |
1706 } // namespace webkit | 1707 } // namespace webkit |
OLD | NEW |