| 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 #ifndef CHROME_BROWSER_FILE_SELECT_HELPER_H_ | 5 #ifndef CHROME_BROWSER_FILE_SELECT_HELPER_H_ |
| 6 #define CHROME_BROWSER_FILE_SELECT_HELPER_H_ | 6 #define CHROME_BROWSER_FILE_SELECT_HELPER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
| 13 #include "base/memory/scoped_ptr.h" |
| 13 #include "content/public/browser/notification_observer.h" | 14 #include "content/public/browser/notification_observer.h" |
| 14 #include "content/public/browser/notification_registrar.h" | 15 #include "content/public/browser/notification_registrar.h" |
| 15 #include "content/public/browser/web_contents_observer.h" | 16 #include "content/public/browser/web_contents_observer.h" |
| 16 #include "content/public/common/file_chooser_params.h" | 17 #include "content/public/common/file_chooser_params.h" |
| 17 #include "net/base/directory_lister.h" | 18 #include "net/base/directory_lister.h" |
| 18 #include "ui/shell_dialogs/select_file_dialog.h" | 19 #include "ui/shell_dialogs/select_file_dialog.h" |
| 19 | 20 |
| 21 #if defined(FULL_SAFE_BROWSING) |
| 22 #include "chrome/browser/safe_browsing/unverified_download_policy.h" |
| 23 #endif |
| 24 |
| 20 class Profile; | 25 class Profile; |
| 21 | 26 |
| 22 namespace content { | 27 namespace content { |
| 23 struct FileChooserFileInfo; | 28 struct FileChooserFileInfo; |
| 24 class RenderViewHost; | 29 class RenderViewHost; |
| 25 class WebContents; | 30 class WebContents; |
| 26 } | 31 } |
| 27 | 32 |
| 28 namespace ui { | 33 namespace ui { |
| 29 struct SelectedFileInfo; | 34 struct SelectedFileInfo; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 private: | 76 private: |
| 72 // This FileSelectHelper owns this object. | 77 // This FileSelectHelper owns this object. |
| 73 FileSelectHelper* parent_; | 78 FileSelectHelper* parent_; |
| 74 int id_; | 79 int id_; |
| 75 | 80 |
| 76 DISALLOW_COPY_AND_ASSIGN(DirectoryListerDispatchDelegate); | 81 DISALLOW_COPY_AND_ASSIGN(DirectoryListerDispatchDelegate); |
| 77 }; | 82 }; |
| 78 | 83 |
| 79 void RunFileChooser(content::RenderViewHost* render_view_host, | 84 void RunFileChooser(content::RenderViewHost* render_view_host, |
| 80 content::WebContents* web_contents, | 85 content::WebContents* web_contents, |
| 81 const content::FileChooserParams& params); | 86 scoped_ptr<content::FileChooserParams> params); |
| 82 void RunFileChooserOnFileThread( | 87 void GetFileTypesOnFileThread(scoped_ptr<content::FileChooserParams> params); |
| 83 const content::FileChooserParams& params); | 88 void GetSanitizedFilenameOnUIThread( |
| 84 void RunFileChooserOnUIThread( | 89 scoped_ptr<content::FileChooserParams> params); |
| 85 const content::FileChooserParams& params); | 90 #if defined(FULL_SAFE_BROWSING) |
| 91 void ApplyUnverifiedDownloadPolicy( |
| 92 const base::FilePath& default_path, |
| 93 scoped_ptr<content::FileChooserParams> params, |
| 94 safe_browsing::UnverifiedDownloadPolicy policy); |
| 95 #endif |
| 96 void RunFileChooserOnUIThread(const base::FilePath& default_path, |
| 97 scoped_ptr<content::FileChooserParams> params); |
| 86 | 98 |
| 87 // Cleans up and releases this instance. This must be called after the last | 99 // Cleans up and releases this instance. This must be called after the last |
| 88 // callback is received from the file chooser dialog. | 100 // callback is received from the file chooser dialog. |
| 89 void RunFileChooserEnd(); | 101 void RunFileChooserEnd(); |
| 90 | 102 |
| 91 // SelectFileDialog::Listener overrides. | 103 // SelectFileDialog::Listener overrides. |
| 92 void FileSelected(const base::FilePath& path, | 104 void FileSelected(const base::FilePath& path, |
| 93 int index, | 105 int index, |
| 94 void* params) override; | 106 void* params) override; |
| 95 void FileSelectedWithExtraInfo(const ui::SelectedFileInfo& file, | 107 void FileSelectedWithExtraInfo(const ui::SelectedFileInfo& file, |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 content::NotificationRegistrar notification_registrar_; | 234 content::NotificationRegistrar notification_registrar_; |
| 223 | 235 |
| 224 // Temporary files only used on OSX. This class is responsible for deleting | 236 // Temporary files only used on OSX. This class is responsible for deleting |
| 225 // these files when they are no longer needed. | 237 // these files when they are no longer needed. |
| 226 std::vector<base::FilePath> temporary_files_; | 238 std::vector<base::FilePath> temporary_files_; |
| 227 | 239 |
| 228 DISALLOW_COPY_AND_ASSIGN(FileSelectHelper); | 240 DISALLOW_COPY_AND_ASSIGN(FileSelectHelper); |
| 229 }; | 241 }; |
| 230 | 242 |
| 231 #endif // CHROME_BROWSER_FILE_SELECT_HELPER_H_ | 243 #endif // CHROME_BROWSER_FILE_SELECT_HELPER_H_ |
| OLD | NEW |