| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/glue/plugins/plugin_host.h" | 5 #include "webkit/glue/plugins/plugin_host.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 static const char kFileUrlPrefix[] = "file:"; | 443 static const char kFileUrlPrefix[] = "file:"; |
| 444 if (StartsWithASCII(file_path_ascii, kFileUrlPrefix, false)) { | 444 if (StartsWithASCII(file_path_ascii, kFileUrlPrefix, false)) { |
| 445 GURL file_url(file_path_ascii); | 445 GURL file_url(file_path_ascii); |
| 446 DCHECK(file_url.SchemeIsFile()); | 446 DCHECK(file_url.SchemeIsFile()); |
| 447 net::FileURLToFilePath(file_url, &file_path); | 447 net::FileURLToFilePath(file_url, &file_path); |
| 448 } else { | 448 } else { |
| 449 file_path = FilePath::FromWStringHack( | 449 file_path = FilePath::FromWStringHack( |
| 450 base::SysNativeMBToWide(file_path_ascii)); | 450 base::SysNativeMBToWide(file_path_ascii)); |
| 451 } | 451 } |
| 452 | 452 |
| 453 file_util::FileInfo post_file_info = {0}; | 453 base::PlatformFileInfo post_file_info = {0}; |
| 454 if (!file_util::GetFileInfo(file_path, &post_file_info) || | 454 if (!file_util::GetFileInfo(file_path, &post_file_info) || |
| 455 post_file_info.is_directory) | 455 post_file_info.is_directory) |
| 456 return NPERR_FILE_NOT_FOUND; | 456 return NPERR_FILE_NOT_FOUND; |
| 457 | 457 |
| 458 if (!file_util::ReadFileToString(file_path, &post_file_contents)) | 458 if (!file_util::ReadFileToString(file_path, &post_file_contents)) |
| 459 return NPERR_FILE_NOT_FOUND; | 459 return NPERR_FILE_NOT_FOUND; |
| 460 | 460 |
| 461 buf = post_file_contents.c_str(); | 461 buf = post_file_contents.c_str(); |
| 462 len = post_file_contents.size(); | 462 len = post_file_contents.size(); |
| 463 } | 463 } |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1080 scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); | 1080 scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); |
| 1081 if (plugin.get()) { | 1081 if (plugin.get()) { |
| 1082 return plugin->ConvertPoint(sourceX, sourceY, sourceSpace, | 1082 return plugin->ConvertPoint(sourceX, sourceY, sourceSpace, |
| 1083 destX, destY, destSpace); | 1083 destX, destY, destSpace); |
| 1084 } | 1084 } |
| 1085 NOTREACHED(); | 1085 NOTREACHED(); |
| 1086 return false; | 1086 return false; |
| 1087 } | 1087 } |
| 1088 | 1088 |
| 1089 } // extern "C" | 1089 } // extern "C" |
| OLD | NEW |