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_
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"
20 // Chrome "Downloads" settings page UI handler.
21 class DownloadsHandler
: public SettingsPageUIHandler
,
22 public ui::SelectFileDialog::Listener
{
25 ~DownloadsHandler() override
;
27 // SettingsPageUIHandler implementation.
28 void RegisterMessages() override
;
31 // SelectFileDialog::Listener implementation.
32 void FileSelected(const base::FilePath
& path
,
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_