| 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/ui/chrome_select_file_policy.h" | 5 #include "chrome/browser/ui/chrome_select_file_policy.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 const base::FilePath file_path; | 50 const base::FilePath file_path; |
| 51 const string16 title=string16(); | 51 const string16 title=string16(); |
| 52 | 52 |
| 53 file_selection_initialisation_in_progress = true; | 53 file_selection_initialisation_in_progress = true; |
| 54 select_file_dialog_->SelectFile(ui::SelectFileDialog::SELECT_OPEN_FILE, | 54 select_file_dialog_->SelectFile(ui::SelectFileDialog::SELECT_OPEN_FILE, |
| 55 title, | 55 title, |
| 56 file_path, | 56 file_path, |
| 57 NULL, | 57 NULL, |
| 58 0, | 58 0, |
| 59 FILE_PATH_LITERAL(std::string()), | 59 base::FilePath::StringType()), |
| 60 NULL, | 60 NULL, |
| 61 NULL); | 61 NULL); |
| 62 file_selection_initialisation_in_progress = false; | 62 file_selection_initialisation_in_progress = false; |
| 63 } | 63 } |
| 64 | 64 |
| 65 // ui::SelectFileDialog::Listener implementation. | 65 // ui::SelectFileDialog::Listener implementation. |
| 66 virtual void FileSelected(const base::FilePath& path, | 66 virtual void FileSelected(const base::FilePath& path, |
| 67 int index, void* params) OVERRIDE{ | 67 int index, void* params) OVERRIDE{ |
| 68 ASSERT_FALSE(file_selection_initialisation_in_progress); | 68 ASSERT_FALSE(file_selection_initialisation_in_progress); |
| 69 } | 69 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 96 TestingBrowserProcess::GetGlobal()); | 96 TestingBrowserProcess::GetGlobal()); |
| 97 | 97 |
| 98 scoped_ptr<FileSelectionUser> file_selection_user(new FileSelectionUser()); | 98 scoped_ptr<FileSelectionUser> file_selection_user(new FileSelectionUser()); |
| 99 | 99 |
| 100 // Disallow file-selection dialogs. | 100 // Disallow file-selection dialogs. |
| 101 local_state.Get()->SetManagedPref(prefs::kAllowFileSelectionDialogs, | 101 local_state.Get()->SetManagedPref(prefs::kAllowFileSelectionDialogs, |
| 102 new base::FundamentalValue(false)); | 102 new base::FundamentalValue(false)); |
| 103 | 103 |
| 104 file_selection_user->StartFileSelection(); | 104 file_selection_user->StartFileSelection(); |
| 105 } | 105 } |
| OLD | NEW |