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 "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 2404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2415 } | 2415 } |
2416 | 2416 |
2417 bool RenderViewImpl::runFileChooser( | 2417 bool RenderViewImpl::runFileChooser( |
2418 const WebKit::WebFileChooserParams& params, | 2418 const WebKit::WebFileChooserParams& params, |
2419 WebFileChooserCompletion* chooser_completion) { | 2419 WebFileChooserCompletion* chooser_completion) { |
2420 // Do not open the file dialog in a hidden RenderView. | 2420 // Do not open the file dialog in a hidden RenderView. |
2421 if (is_hidden()) | 2421 if (is_hidden()) |
2422 return false; | 2422 return false; |
2423 FileChooserParams ipc_params; | 2423 FileChooserParams ipc_params; |
2424 if (params.directory) | 2424 if (params.directory) |
2425 ipc_params.mode = FileChooserParams::OpenFolder; | 2425 ipc_params.mode = FileChooserParams::UploadFolder; |
2426 else if (params.multiSelect) | 2426 else if (params.multiSelect) |
2427 ipc_params.mode = FileChooserParams::OpenMultiple; | 2427 ipc_params.mode = FileChooserParams::OpenMultiple; |
2428 else if (params.saveAs) | 2428 else if (params.saveAs) |
2429 ipc_params.mode = FileChooserParams::Save; | 2429 ipc_params.mode = FileChooserParams::Save; |
2430 else | 2430 else |
2431 ipc_params.mode = FileChooserParams::Open; | 2431 ipc_params.mode = FileChooserParams::Open; |
2432 ipc_params.title = params.title; | 2432 ipc_params.title = params.title; |
2433 ipc_params.default_file_name = | 2433 ipc_params.default_file_name = |
2434 base::FilePath::FromUTF16Unsafe(params.initialValue); | 2434 base::FilePath::FromUTF16Unsafe(params.initialValue); |
2435 ipc_params.accept_types.reserve(params.acceptTypes.size()); | 2435 ipc_params.accept_types.reserve(params.acceptTypes.size()); |
(...skipping 3968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6404 WebURL url = icon_urls[i].iconURL(); | 6404 WebURL url = icon_urls[i].iconURL(); |
6405 if (!url.isEmpty()) | 6405 if (!url.isEmpty()) |
6406 urls.push_back(FaviconURL(url, | 6406 urls.push_back(FaviconURL(url, |
6407 ToFaviconType(icon_urls[i].iconType()))); | 6407 ToFaviconType(icon_urls[i].iconType()))); |
6408 } | 6408 } |
6409 SendUpdateFaviconURL(urls); | 6409 SendUpdateFaviconURL(urls); |
6410 } | 6410 } |
6411 | 6411 |
6412 | 6412 |
6413 } // namespace content | 6413 } // namespace content |
OLD | NEW |