| Index: chrome/browser/extensions/file_manager_util.cc
|
| diff --git a/chrome/browser/extensions/file_manager_util.cc b/chrome/browser/extensions/file_manager_util.cc
|
| index 833e81711bfc776630e1e4a731ebeb3395a4f065..7beef7cdc125021e38f3538ee63b0f33defab1fa 100644
|
| --- a/chrome/browser/extensions/file_manager_util.cc
|
| +++ b/chrome/browser/extensions/file_manager_util.cc
|
| @@ -16,7 +16,7 @@
|
| #include "content/browser/browser_thread.h"
|
| #include "content/browser/user_metrics.h"
|
| #include "grit/generated_resources.h"
|
| -#include "third_party/libjingle/source/talk/base/urlencode.h"
|
| +#include "net/base/escape.h"
|
| #include "ui/base/l10n/l10n_util.h"
|
| #include "webkit/fileapi/file_system_context.h"
|
| #include "webkit/fileapi/file_system_mount_point_provider.h"
|
| @@ -112,16 +112,17 @@ GURL FileManagerUtil::GetFileBrowserUrlWithParams(
|
| std::string json = GetArgumentsJson(type, title, default_path, file_types,
|
| file_type_index, default_extension);
|
| return GURL(FileManagerUtil::GetFileBrowserUrl().spec() + "?" +
|
| - UrlEncodeStringWithoutEncodingSpaceAsPlus(json));
|
| + EscapeUrlEncodedData(json, false));
|
|
|
| }
|
| +
|
| // static
|
| void FileManagerUtil::ShowFullTabUrl(Profile*,
|
| const FilePath& default_path) {
|
| std::string json = GetArgumentsJson(SelectFileDialog::SELECT_NONE, string16(),
|
| default_path, NULL, 0, FilePath::StringType());
|
| GURL url(std::string(kBaseFileBrowserUrl) + "?" +
|
| - UrlEncodeStringWithoutEncodingSpaceAsPlus(json));
|
| + EscapeUrlEncodedData(json, false));
|
| Browser* browser = BrowserList::GetLastActive();
|
| if (!browser)
|
| return;
|
| @@ -130,7 +131,6 @@ void FileManagerUtil::ShowFullTabUrl(Profile*,
|
| browser->ShowSingletonTab(GURL(url));
|
| }
|
|
|
| -
|
| void FileManagerUtil::ViewItem(const FilePath& full_path, bool enqueue) {
|
| std::string ext = full_path.Extension();
|
| // For things supported natively by the browser, we should open it
|
| @@ -138,7 +138,7 @@ void FileManagerUtil::ViewItem(const FilePath& full_path, bool enqueue) {
|
| if (IsSupportedBrowserExtension(ext.data())) {
|
| std::string path;
|
| path = "file://";
|
| - path.append(full_path.value());
|
| + path.append(EscapeUrlEncodedData(full_path.value(), false));
|
| if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
|
| bool result = BrowserThread::PostTask(
|
| BrowserThread::UI, FROM_HERE,
|
| @@ -190,9 +190,9 @@ std::string FileManagerUtil::GetArgumentsJson(
|
| arg_value.SetString("defaultPath", default_path.value());
|
| arg_value.SetString("defaultExtension", default_extension);
|
|
|
| - ListValue* types_list = new ListValue();
|
|
|
| if (file_types) {
|
| + ListValue* types_list = new ListValue();
|
| for (size_t i = 0; i < file_types->extensions.size(); ++i) {
|
| ListValue* extensions_list = new ListValue();
|
| for (size_t j = 0; j < file_types->extensions[i].size(); ++j) {
|
| @@ -213,6 +213,7 @@ std::string FileManagerUtil::GetArgumentsJson(
|
|
|
| types_list->Set(i, dict);
|
| }
|
| + arg_value.Set("typeList", types_list);
|
| }
|
|
|
| std::string rv;
|
|
|