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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 #endif | 419 #endif |
420 | 420 |
421 select_file_dialog_->SelectFile( | 421 select_file_dialog_->SelectFile( |
422 dialog_type_, | 422 dialog_type_, |
423 params.title, | 423 params.title, |
424 default_file_name, | 424 default_file_name, |
425 select_file_types_.get(), | 425 select_file_types_.get(), |
426 select_file_types_.get() && !select_file_types_->extensions.empty() | 426 select_file_types_.get() && !select_file_types_->extensions.empty() |
427 ? 1 | 427 ? 1 |
428 : 0, // 1-based index of default extension to show. | 428 : 0, // 1-based index of default extension to show. |
429 FILE_PATH_LITERAL(std::string()), | 429 base::FilePath::StringType(), |
430 owning_window, | 430 owning_window, |
431 #if defined(OS_ANDROID) | 431 #if defined(OS_ANDROID) |
432 &accept_types); | 432 &accept_types); |
433 #else | 433 #else |
434 NULL); | 434 NULL); |
435 #endif | 435 #endif |
436 | 436 |
437 select_file_types_.reset(); | 437 select_file_types_.reset(); |
438 } | 438 } |
439 | 439 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 // A 1 character accept type will always be invalid (either a "." in the case | 494 // A 1 character accept type will always be invalid (either a "." in the case |
495 // of an extension or a "/" in the case of a MIME type). | 495 // of an extension or a "/" in the case of a MIME type). |
496 std::string unused; | 496 std::string unused; |
497 if (accept_type.length() <= 1 || | 497 if (accept_type.length() <= 1 || |
498 StringToLowerASCII(accept_type) != accept_type || | 498 StringToLowerASCII(accept_type) != accept_type || |
499 TrimWhitespaceASCII(accept_type, TRIM_ALL, &unused) != TRIM_NONE) { | 499 TrimWhitespaceASCII(accept_type, TRIM_ALL, &unused) != TRIM_NONE) { |
500 return false; | 500 return false; |
501 } | 501 } |
502 return true; | 502 return true; |
503 } | 503 } |
OLD | NEW |