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 2399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2410 } | 2410 } |
2411 | 2411 |
2412 bool RenderViewImpl::runFileChooser( | 2412 bool RenderViewImpl::runFileChooser( |
2413 const WebKit::WebFileChooserParams& params, | 2413 const WebKit::WebFileChooserParams& params, |
2414 WebFileChooserCompletion* chooser_completion) { | 2414 WebFileChooserCompletion* chooser_completion) { |
2415 // Do not open the file dialog in a hidden RenderView. | 2415 // Do not open the file dialog in a hidden RenderView. |
2416 if (is_hidden()) | 2416 if (is_hidden()) |
2417 return false; | 2417 return false; |
2418 FileChooserParams ipc_params; | 2418 FileChooserParams ipc_params; |
2419 if (params.directory) | 2419 if (params.directory) |
2420 ipc_params.mode = FileChooserParams::OpenFolder; | 2420 ipc_params.mode = FileChooserParams::UploadFolder; |
2421 else if (params.multiSelect) | 2421 else if (params.multiSelect) |
2422 ipc_params.mode = FileChooserParams::OpenMultiple; | 2422 ipc_params.mode = FileChooserParams::OpenMultiple; |
2423 else if (params.saveAs) | 2423 else if (params.saveAs) |
2424 ipc_params.mode = FileChooserParams::Save; | 2424 ipc_params.mode = FileChooserParams::Save; |
2425 else | 2425 else |
2426 ipc_params.mode = FileChooserParams::Open; | 2426 ipc_params.mode = FileChooserParams::Open; |
2427 ipc_params.title = params.title; | 2427 ipc_params.title = params.title; |
2428 ipc_params.default_file_name = | 2428 ipc_params.default_file_name = |
2429 base::FilePath::FromUTF16Unsafe(params.initialValue); | 2429 base::FilePath::FromUTF16Unsafe(params.initialValue); |
2430 ipc_params.accept_types.reserve(params.acceptTypes.size()); | 2430 ipc_params.accept_types.reserve(params.acceptTypes.size()); |
(...skipping 3945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6376 WebURL url = icon_urls[i].iconURL(); | 6376 WebURL url = icon_urls[i].iconURL(); |
6377 if (!url.isEmpty()) | 6377 if (!url.isEmpty()) |
6378 urls.push_back(FaviconURL(url, | 6378 urls.push_back(FaviconURL(url, |
6379 ToFaviconType(icon_urls[i].iconType()))); | 6379 ToFaviconType(icon_urls[i].iconType()))); |
6380 } | 6380 } |
6381 SendUpdateFaviconURL(urls); | 6381 SendUpdateFaviconURL(urls); |
6382 } | 6382 } |
6383 | 6383 |
6384 | 6384 |
6385 } // namespace content | 6385 } // namespace content |
OLD | NEW |