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

Unified Diff: content/renderer/render_view_impl.cc

Issue 16927005: Use {As,From}UTF16Unsafe instead of file_path_string_conversions.{h,cc}. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 826e12121b8177e8839c95fe638babe5d07728ab..e55fb8a94b1fbe3c877de83315d94ef5f1f5af49 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -14,6 +14,7 @@
#include "base/compiler_specific.h"
#include "base/debug/alias.h"
#include "base/debug/trace_event.h"
+#include "base/files/file_path.h"
#include "base/json/json_writer.h"
#include "base/lazy_instance.h"
#include "base/memory/scoped_ptr.h"
@@ -200,7 +201,6 @@
#include "ui/gfx/size_conversions.h"
#include "ui/shell_dialogs/selected_file_info.h"
#include "v8/include/v8.h"
-#include "webkit/base/file_path_string_conversions.h"
#include "webkit/common/dom_storage/dom_storage_types.h"
#include "webkit/common/webdropdata.h"
#include "webkit/glue/webkit_glue.h"
@@ -2247,7 +2247,7 @@ bool RenderViewImpl::enumerateChosenDirectory(
return Send(new ViewHostMsg_EnumerateDirectory(
routing_id_,
id,
- webkit_base::WebStringToFilePath(path)));
+ base::FilePath::FromUTF16Unsafe(path)));
}
void RenderViewImpl::initializeHelperPluginWebFrame(
@@ -2376,7 +2376,7 @@ bool RenderViewImpl::runFileChooser(
ipc_params.mode = FileChooserParams::Open;
ipc_params.title = params.title;
ipc_params.default_file_name =
- webkit_base::WebStringToFilePath(params.initialValue);
+ base::FilePath::FromUTF16Unsafe(params.initialValue);
ipc_params.accept_types.reserve(params.acceptTypes.size());
for (size_t i = 0; i < params.acceptTypes.size(); ++i)
ipc_params.accept_types.push_back(params.acceptTypes[i]);
@@ -5424,7 +5424,7 @@ void RenderViewImpl::OnEnumerateDirectoryResponse(
WebVector<WebString> ws_file_names(paths.size());
for (size_t i = 0; i < paths.size(); ++i)
- ws_file_names[i] = webkit_base::FilePathToWebString(paths[i]);
+ ws_file_names[i] = paths[i].AsUTF16Unsafe();
enumeration_completions_[id]->didChooseFile(ws_file_names);
enumeration_completions_.erase(id);
@@ -5442,9 +5442,9 @@ void RenderViewImpl::OnFileChooserResponse(
files.size());
for (size_t i = 0; i < files.size(); ++i) {
WebFileChooserCompletion::SelectedFileInfo selected_file;
- selected_file.path = webkit_base::FilePathToWebString(files[i].local_path);
- selected_file.displayName = webkit_base::FilePathStringToWebString(
- files[i].display_name);
+ selected_file.path = files[i].local_path.AsUTF16Unsafe();
+ selected_file.displayName =
+ base::FilePath(files[i].display_name).AsUTF16Unsafe();
selected_files[i] = selected_file;
}
@@ -5616,15 +5616,14 @@ void RenderViewImpl::OnGetSerializedHtmlDataForCurrentPageWithLocalLinks(
// Convert std::vector of GURLs to WebVector<WebURL>
WebVector<WebURL> weburl_links(links);
- // Convert std::vector of std::strings to WebVector<WebString>
+ // Convert std::vector of base::FilePath to WebVector<WebString>
WebVector<WebString> webstring_paths(local_paths.size());
for (size_t i = 0; i < local_paths.size(); i++)
- webstring_paths[i] = webkit_base::FilePathToWebString(local_paths[i]);
+ webstring_paths[i] = local_paths[i].AsUTF16Unsafe();
WebPageSerializer::serialize(webview()->mainFrame(), true, this, weburl_links,
webstring_paths,
- webkit_base::FilePathToWebString(
- local_directory_name));
+ local_directory_name.AsUTF16Unsafe());
}
void RenderViewImpl::OnShouldClose() {
« no previous file with comments | « content/renderer/dom_serializer_browsertest.cc ('k') | content/renderer/renderer_webkitplatformsupport_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698