blob: e090ed36ce14b8d5cd177ee23e4bd40deeaf7385 [file] [log] [blame]
[email protected]0ffaa482011-07-14 23:41:281// 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
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_FILE_PICKER_H_
6#define CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_FILE_PICKER_H_
7#pragma once
8
9#include "base/memory/ref_counted.h"
[email protected]680d2d42011-07-18 22:58:2110#include "base/memory/weak_ptr.h"
[email protected]0ffaa482011-07-14 23:41:2811#include "chrome/browser/ui/shell_dialogs.h"
12
[email protected]e7557f172011-08-19 23:42:0113class DownloadPrefs;
[email protected]0ffaa482011-07-14 23:41:2814class FilePath;
15class SavePackage;
16
17// Handles showing a dialog to the user to ask for the filename to save a page.
18class SavePackageFilePicker : public SelectFileDialog::Listener {
19 public:
[email protected]680d2d42011-07-18 22:58:2120 SavePackageFilePicker(const base::WeakPtr<SavePackage>& save_package,
[email protected]0ffaa482011-07-14 23:41:2821 const FilePath& suggested_path,
[email protected]e7557f172011-08-19 23:42:0122 bool can_save_as_complete,
23 DownloadPrefs* download_prefs);
[email protected]d089c602011-07-14 23:49:5624 virtual ~SavePackageFilePicker();
[email protected]0ffaa482011-07-14 23:41:2825
26 // Used to disable prompting the user for a directory/filename of the saved
27 // web page. This is available for testing.
28 static void SetShouldPromptUser(bool should_prompt);
29
30 private:
31 // SelectFileDialog::Listener implementation.
32 virtual void FileSelected(const FilePath& path, int index, void* params);
33 virtual void FileSelectionCanceled(void* params);
34
[email protected]680d2d42011-07-18 22:58:2135 base::WeakPtr<SavePackage> save_package_;
[email protected]0ffaa482011-07-14 23:41:2836
37 // For managing select file dialogs.
38 scoped_refptr<SelectFileDialog> select_file_dialog_;
39
40 DISALLOW_COPY_AND_ASSIGN(SavePackageFilePicker);
41};
42
43#endif // CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_FILE_PICKER_H_