OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_FILE_PICKER_CHROMEOS_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_FILE_PICKER_CHROMEOS_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/platform_file.h" |
| 10 #include "chrome/browser/download/save_package_file_picker.h" |
| 11 #include "content/public/browser/web_contents_observer.h" |
| 12 |
| 13 namespace gdata { |
| 14 class GDataFileSystem; |
| 15 } |
| 16 |
| 17 // Handles showing a dialog to the user to ask for the filename to save a page |
| 18 // on ChromeOS. |
| 19 class SavePackageFilePickerChromeOS : public SavePackageFilePicker, |
| 20 public content::WebContentsObserver { |
| 21 public: |
| 22 SavePackageFilePickerChromeOS(content::WebContents* web_contents, |
| 23 const FilePath& suggested_path, |
| 24 const FilePath::StringType& default_extension, |
| 25 bool can_save_as_complete, |
| 26 DownloadPrefs* download_prefs, |
| 27 content::SaveFilePathPickedCallback callback); |
| 28 |
| 29 private: |
| 30 virtual ~SavePackageFilePickerChromeOS(); |
| 31 |
| 32 // SelectFileDialog::Listener implementation. |
| 33 virtual void FileSelected(const FilePath& path, |
| 34 int index, |
| 35 void* params) OVERRIDE; |
| 36 |
| 37 // Calls WebContent::GenerateMHTML. |
| 38 void GenerateMHTML(FilePath* gdata_tmp_download_path); |
| 39 |
| 40 // Callback for WebContents::GenerateMHTML. |
| 41 void MHTMLGenerated(const FilePath& file_path, int64 file_size); |
| 42 |
| 43 // GDataFileSystem::TransferFile callback. |
| 44 void OnTransferFile(base::PlatformFileError error); |
| 45 |
| 46 // Use web_contents() to get at GDataFileSystem. |
| 47 gdata::GDataFileSystem* GetGDataFileSystem(); |
| 48 |
| 49 FilePath selected_path_; |
| 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(SavePackageFilePickerChromeOS); |
| 52 }; |
| 53 |
| 54 #endif // CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_FILE_PICKER_CHROMEOS_H_ |
OLD | NEW |