Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: chrome/browser/download/save_package_file_picker.h

Issue 10069014: Save Page As MHTML (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_H_ 5 #ifndef CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_FILE_PICKER_H_
6 #define CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_FILE_PICKER_H_ 6 #define CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_FILE_PICKER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/callback.h"
10 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
11 #include "chrome/browser/ui/select_file_dialog.h" 10 #include "chrome/browser/ui/select_file_dialog.h"
12 #include "content/public/browser/download_manager_delegate.h" 11 #include "content/public/browser/download_manager_delegate.h"
13 12
14 class DownloadPrefs; 13 class DownloadPrefs;
15 14
16 // Handles showing a dialog to the user to ask for the filename to save a page. 15 // Handles showing a dialog to the user to ask for the filename to save a page.
17 class SavePackageFilePicker : public SelectFileDialog::Listener { 16 class SavePackageFilePicker : public SelectFileDialog::Listener {
18 public: 17 public:
19 SavePackageFilePicker(content::WebContents* web_contents, 18 SavePackageFilePicker(content::WebContents* web_contents,
20 const FilePath& suggested_path, 19 const FilePath& suggested_path,
21 const FilePath::StringType& default_extension, 20 const FilePath::StringType& default_extension,
22 bool can_save_as_complete, 21 bool can_save_as_complete,
23 DownloadPrefs* download_prefs, 22 DownloadPrefs* download_prefs,
24 content::SaveFilePathPickedCallback callback); 23 const content::SavePackagePathPickedCallback& callback);
25 virtual ~SavePackageFilePicker(); 24 virtual ~SavePackageFilePicker();
26 25
27 // Used to disable prompting the user for a directory/filename of the saved 26 // Used to disable prompting the user for a directory/filename of the saved
28 // web page. This is available for testing. 27 // web page. This is available for testing.
29 static void SetShouldPromptUser(bool should_prompt); 28 static void SetShouldPromptUser(bool should_prompt);
30 29
31 private: 30 private:
32 // SelectFileDialog::Listener implementation. 31 // SelectFileDialog::Listener implementation.
33 virtual void FileSelected(const FilePath& path, 32 virtual void FileSelected(const FilePath& path,
34 int index, 33 int index,
35 void* params) OVERRIDE; 34 void* unused_params) OVERRIDE;
36 virtual void FileSelectionCanceled(void* params) OVERRIDE; 35 virtual void FileSelectionCanceled(void* unused_params) OVERRIDE;
36
37 bool ShouldSaveAsMHTML() const;
37 38
38 // Used to look up the renderer process for this request to get the context. 39 // Used to look up the renderer process for this request to get the context.
39 int render_process_id_; 40 int render_process_id_;
40 41
41 content::SaveFilePathPickedCallback callback_; 42 // Whether the web page can be saved as a complete HTML file.
43 bool can_save_as_complete_;
44
45 content::SavePackagePathPickedCallback callback_;
42 46
43 // For managing select file dialogs. 47 // For managing select file dialogs.
44 scoped_refptr<SelectFileDialog> select_file_dialog_; 48 scoped_refptr<SelectFileDialog> select_file_dialog_;
45 49
46 DISALLOW_COPY_AND_ASSIGN(SavePackageFilePicker); 50 DISALLOW_COPY_AND_ASSIGN(SavePackageFilePicker);
47 }; 51 };
48 52
49 #endif // CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_FILE_PICKER_H_ 53 #endif // CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_FILE_PICKER_H_
OLDNEW
« no previous file with comments | « chrome/browser/download/chrome_download_manager_delegate.cc ('k') | chrome/browser/download/save_package_file_picker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698