Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / ui / webui / settings / downloads_handler.h
blobd4b0aff19b42e058d707e1ff7fd13f44d45f1f6c
1 // Copyright (c) 2015 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.
5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_DOWNLOADS_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_DOWNLOADS_HANDLER_H_
8 #include <vector>
10 #include "base/memory/scoped_ptr.h"
11 #include "chrome/browser/ui/webui/settings/md_settings_ui.h"
12 #include "ui/shell_dialogs/select_file_dialog.h"
14 namespace base {
15 class Value;
18 namespace settings {
20 // Chrome "Downloads" settings page UI handler.
21 class DownloadsHandler : public SettingsPageUIHandler,
22 public ui::SelectFileDialog::Listener {
23 public:
24 DownloadsHandler();
25 ~DownloadsHandler() override;
27 // SettingsPageUIHandler implementation.
28 void RegisterMessages() override;
30 private:
31 // SelectFileDialog::Listener implementation.
32 void FileSelected(const base::FilePath& path,
33 int index,
34 void* params) override;
36 // Callback for the "selectDownloadLocation" message. This will prompt the
37 // user for a destination folder using platform-specific APIs.
38 void HandleSelectDownloadLocation(const base::ListValue* args);
40 scoped_refptr<ui::SelectFileDialog> select_folder_dialog_;
42 DISALLOW_COPY_AND_ASSIGN(DownloadsHandler);
45 } // namespace settings
47 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_DOWNLOADS_HANDLER_H_