| 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_DOWNLOAD_SAVE_PACKAGE_FILE_PICKER_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_FILE_PICKER_CHROMEOS_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_FILE_PICKER_CHROMEOS_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_FILE_PICKER_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "chrome/browser/ui/select_file_dialog.h" | 9 #include "chrome/browser/ui/select_file_dialog.h" |
| 10 #include "content/public/browser/download_manager_delegate.h" | 10 #include "content/public/browser/download_manager_delegate.h" |
| 11 #include "content/public/browser/web_contents_observer.h" | 11 #include "content/public/browser/web_contents_observer.h" |
| 12 | 12 |
| 13 namespace gdata { | 13 namespace gdata { |
| 14 class GDataFileSystem; | 14 class GDataFileSystem; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace ui { |
| 18 struct SelectedFileInfo; |
| 19 } |
| 20 |
| 17 // Handles showing a dialog to the user to ask for the filename to save a page | 21 // Handles showing a dialog to the user to ask for the filename to save a page |
| 18 // on ChromeOS. | 22 // on ChromeOS. |
| 19 class SavePackageFilePickerChromeOS : public SelectFileDialog::Listener, | 23 class SavePackageFilePickerChromeOS : public SelectFileDialog::Listener, |
| 20 public content::WebContentsObserver { | 24 public content::WebContentsObserver { |
| 21 public: | 25 public: |
| 22 SavePackageFilePickerChromeOS( | 26 SavePackageFilePickerChromeOS( |
| 23 content::WebContents* web_contents, | 27 content::WebContents* web_contents, |
| 24 const FilePath& suggested_path, | 28 const FilePath& suggested_path, |
| 25 const content::SavePackagePathPickedCallback& callback); | 29 const content::SavePackagePathPickedCallback& callback); |
| 26 | 30 |
| 27 // Used to disable prompting the user for a directory/filename of the saved | 31 // Used to disable prompting the user for a directory/filename of the saved |
| 28 // web page. This is available for testing. | 32 // web page. This is available for testing. |
| 29 static void SetShouldPromptUser(bool should_prompt); | 33 static void SetShouldPromptUser(bool should_prompt); |
| 30 | 34 |
| 31 private: | 35 private: |
| 32 virtual ~SavePackageFilePickerChromeOS(); | 36 virtual ~SavePackageFilePickerChromeOS(); |
| 33 | 37 |
| 34 // SelectFileDialog::Listener implementation. | 38 // SelectFileDialog::Listener implementation. |
| 35 virtual void FileSelected(const FilePath& path, | 39 virtual void FileSelected(const FilePath& selected_path, |
| 36 int unused_index, | 40 int unused_index, |
| 37 void* unused_params) OVERRIDE; | 41 void* unused_params) OVERRIDE; |
| 42 virtual void FileSelectedWithExtraInfo( |
| 43 const ui::SelectedFileInfo& selected_file_info, |
| 44 int unused_index, |
| 45 void* unused_params) OVERRIDE; |
| 38 virtual void FileSelectionCanceled(void* params) OVERRIDE; | 46 virtual void FileSelectionCanceled(void* params) OVERRIDE; |
| 39 | 47 |
| 40 content::SavePackagePathPickedCallback callback_; | 48 content::SavePackagePathPickedCallback callback_; |
| 41 | 49 |
| 42 // For managing select file dialogs. | 50 // For managing select file dialogs. |
| 43 scoped_refptr<SelectFileDialog> select_file_dialog_; | 51 scoped_refptr<SelectFileDialog> select_file_dialog_; |
| 44 FilePath selected_path_; | 52 FilePath selected_path_; |
| 45 | 53 |
| 46 DISALLOW_COPY_AND_ASSIGN(SavePackageFilePickerChromeOS); | 54 DISALLOW_COPY_AND_ASSIGN(SavePackageFilePickerChromeOS); |
| 47 }; | 55 }; |
| 48 | 56 |
| 49 #endif // CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_FILE_PICKER_CHROMEOS_H_ | 57 #endif // CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_FILE_PICKER_CHROMEOS_H_ |
| OLD | NEW |