Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: content/common/plugin_list_win.cc

Issue 176843022: Move UTF16ToASCII, remove WideToASCII. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/common/pepper_plugin_list.cc ('k') | content/public/common/webplugininfo.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/common/pepper_plugin_list.cc ('k') | content/public/common/webplugininfo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698