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 "chrome/browser/chromeos/file_manager/url_util.h" | 5 #include "chrome/browser/chromeos/file_manager/url_util.h" |
6 | 6 |
7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/chromeos/file_manager/app_id.h" | 9 #include "chrome/browser/chromeos/file_manager/app_id.h" |
10 #include "net/base/escape.h" | 10 #include "net/base/escape.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 104 |
105 arg_value.SetBoolean("includeAllFiles", file_types->include_all_files); | 105 arg_value.SetBoolean("includeAllFiles", file_types->include_all_files); |
106 } | 106 } |
107 | 107 |
108 // If the caller cannot handle Drive path, the file chooser dialog need to | 108 // If the caller cannot handle Drive path, the file chooser dialog need to |
109 // return resolved local native paths to the selected files. | 109 // return resolved local native paths to the selected files. |
110 arg_value.SetBoolean("shouldReturnLocalPath", | 110 arg_value.SetBoolean("shouldReturnLocalPath", |
111 !file_types || !file_types->support_drive); | 111 !file_types || !file_types->support_drive); |
112 | 112 |
113 std::string json_args; | 113 std::string json_args; |
114 base::JSONWriter::Write(&arg_value, &json_args); | 114 base::JSONWriter::Write(arg_value, &json_args); |
115 | 115 |
116 std::string url = GetFileManagerMainPageUrl().spec() + '?' + | 116 std::string url = GetFileManagerMainPageUrl().spec() + '?' + |
117 net::EscapeUrlEncodedData(json_args, | 117 net::EscapeUrlEncodedData(json_args, |
118 false); // Space to %20 instead of +. | 118 false); // Space to %20 instead of +. |
119 return GURL(url); | 119 return GURL(url); |
120 } | 120 } |
121 | 121 |
122 } // namespace util | 122 } // namespace util |
123 } // namespace file_manager | 123 } // namespace file_manager |
OLD | NEW |