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/file_select_helper.h" | 5 #include "chrome/browser/file_select_helper.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 break; | 326 break; |
327 default: | 327 default: |
328 dialog_type_ = SelectFileDialog::SELECT_OPEN_FILE; // Prevent warning. | 328 dialog_type_ = SelectFileDialog::SELECT_OPEN_FILE; // Prevent warning. |
329 NOTREACHED(); | 329 NOTREACHED(); |
330 } | 330 } |
331 FilePath default_file_name = params.default_file_name; | 331 FilePath default_file_name = params.default_file_name; |
332 if (default_file_name.empty()) | 332 if (default_file_name.empty()) |
333 default_file_name = profile_->last_selected_directory(); | 333 default_file_name = profile_->last_selected_directory(); |
334 | 334 |
335 gfx::NativeWindow owning_window = | 335 gfx::NativeWindow owning_window = |
336 platform_util::GetTopLevel(render_view_host_->view()->GetNativeView()); | 336 platform_util::GetTopLevel(render_view_host_->GetView()->GetNativeView()); |
337 | 337 |
338 select_file_dialog_->SelectFile( | 338 select_file_dialog_->SelectFile( |
339 dialog_type_, | 339 dialog_type_, |
340 params.title, | 340 params.title, |
341 default_file_name, | 341 default_file_name, |
342 select_file_types_.get(), | 342 select_file_types_.get(), |
343 select_file_types_.get() ? 1 : 0, // 1-based index. | 343 select_file_types_.get() ? 1 : 0, // 1-based index. |
344 FILE_PATH_LITERAL(""), | 344 FILE_PATH_LITERAL(""), |
345 web_contents_, | 345 web_contents_, |
346 owning_window, | 346 owning_window, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 DCHECK(content::Source<WebContents>(source).ptr() == web_contents_); | 394 DCHECK(content::Source<WebContents>(source).ptr() == web_contents_); |
395 web_contents_ = NULL; | 395 web_contents_ = NULL; |
396 break; | 396 break; |
397 } | 397 } |
398 | 398 |
399 default: | 399 default: |
400 NOTREACHED(); | 400 NOTREACHED(); |
401 } | 401 } |
402 } | 402 } |
403 | 403 |
OLD | NEW |