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/common/plugin_list.h" | 5 #include "content/common/plugin_list.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/file_version_info.h" | 11 #include "base/file_version_info.h" |
12 #include "base/file_version_info_win.h" | 12 #include "base/file_version_info_win.h" |
13 #include "base/files/memory_mapped_file.h" | 13 #include "base/files/memory_mapped_file.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
17 #include "base/strings/string_split.h" | 17 #include "base/strings/string_split.h" |
18 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
| 19 #include "base/strings/utf_string_conversions.h" |
19 #include "base/win/pe_image.h" | 20 #include "base/win/pe_image.h" |
20 #include "base/win/registry.h" | 21 #include "base/win/registry.h" |
21 #include "base/win/scoped_handle.h" | 22 #include "base/win/scoped_handle.h" |
22 #include "base/win/windows_version.h" | 23 #include "base/win/windows_version.h" |
23 #include "content/common/plugin_constants_win.h" | 24 #include "content/common/plugin_constants_win.h" |
24 | 25 |
25 namespace content { | 26 namespace content { |
26 namespace { | 27 namespace { |
27 | 28 |
28 const base::char16 kRegistryApps[] = | 29 const base::char16 kRegistryApps[] = |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 FileVersionInfoWin* version_info_win = | 278 FileVersionInfoWin* version_info_win = |
278 static_cast<FileVersionInfoWin*>(version_info.get()); | 279 static_cast<FileVersionInfoWin*>(version_info.get()); |
279 | 280 |
280 info->name = version_info->product_name(); | 281 info->name = version_info->product_name(); |
281 info->desc = version_info->file_description(); | 282 info->desc = version_info->file_description(); |
282 info->version = version_info->file_version(); | 283 info->version = version_info->file_version(); |
283 info->path = filename; | 284 info->path = filename; |
284 | 285 |
285 // TODO(evan): Move the ParseMimeTypes code inline once Pepper is updated. | 286 // TODO(evan): Move the ParseMimeTypes code inline once Pepper is updated. |
286 if (!PluginList::ParseMimeTypes( | 287 if (!PluginList::ParseMimeTypes( |
287 UTF16ToASCII(version_info_win->GetStringValue(L"MIMEType")), | 288 base::UTF16ToASCII(version_info_win->GetStringValue(L"MIMEType")), |
288 UTF16ToASCII(version_info_win->GetStringValue(L"FileExtents")), | 289 base::UTF16ToASCII(version_info_win->GetStringValue(L"FileExtents")), |
289 version_info_win->GetStringValue(L"FileOpenName"), | 290 version_info_win->GetStringValue(L"FileOpenName"), |
290 &info->mime_types)) { | 291 &info->mime_types)) { |
291 LOG_IF(ERROR, PluginList::DebugPluginLoading()) | 292 LOG_IF(ERROR, PluginList::DebugPluginLoading()) |
292 << "Plugin " << info->name << " has bad MIME types, skipping"; | 293 << "Plugin " << info->name << " has bad MIME types, skipping"; |
293 return false; | 294 return false; |
294 } | 295 } |
295 | 296 |
296 return true; | 297 return true; |
297 } | 298 } |
298 | 299 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 #if !defined(ARCH_CPU_X86_64) | 466 #if !defined(ARCH_CPU_X86_64) |
466 // The plugin in question could be a 64 bit plugin which we cannot load. | 467 // The plugin in question could be a 64 bit plugin which we cannot load. |
467 base::FilePath plugin_path(info.path); | 468 base::FilePath plugin_path(info.path); |
468 if (!IsValid32BitImage(base::MakeAbsoluteFilePath(plugin_path))) | 469 if (!IsValid32BitImage(base::MakeAbsoluteFilePath(plugin_path))) |
469 return false; | 470 return false; |
470 #endif | 471 #endif |
471 return true; | 472 return true; |
472 } | 473 } |
473 | 474 |
474 } // namespace content | 475 } // namespace content |
OLD | NEW |