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

Unified Diff: chrome/browser/ui/webui/settings/downloads_handler.h

Issue 2711823002: MD Settings: Add "Auto Open" setting to Downloads C++ handler. (Closed)
Patch Set: fix teardown Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/webui/settings/downloads_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/settings/downloads_handler.h
diff --git a/chrome/browser/ui/webui/settings/downloads_handler.h b/chrome/browser/ui/webui/settings/downloads_handler.h
index a5251d373e01750328bac9a682a10cbb5e1679a6..b8c1561b97f0187c2421a66b1ee2d538ba978d01 100644
--- a/chrome/browser/ui/webui/settings/downloads_handler.h
+++ b/chrome/browser/ui/webui/settings/downloads_handler.h
@@ -10,31 +10,47 @@
#include "base/macros.h"
#include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h"
+#include "components/prefs/pref_change_registrar.h"
#include "ui/shell_dialogs/select_file_dialog.h"
+class Profile;
+
namespace settings {
// Chrome "Downloads" settings page UI handler.
class DownloadsHandler : public SettingsPageUIHandler,
public ui::SelectFileDialog::Listener {
public:
- DownloadsHandler();
+ explicit DownloadsHandler(Profile* profile);
~DownloadsHandler() override;
// SettingsPageUIHandler implementation.
void RegisterMessages() override;
- void OnJavascriptAllowed() override {}
- void OnJavascriptDisallowed() override {}
+ void OnJavascriptAllowed() override;
+ void OnJavascriptDisallowed() override;
private:
+ friend class DownloadsHandlerTest;
+ FRIEND_TEST_ALL_PREFIXES(DownloadsHandlerTest, AutoOpenDownloads);
+
+ // Callback for the "initializeDownloads" message. This starts observers and
+ // retrieves the current browser state.
+ void HandleInitialize(const base::ListValue* args);
+
+ void SendAutoOpenDownloadsToJavascript();
+
+ // Callback for the "selectDownloadLocation" message. This will prompt the
+ // user for a destination folder using platform-specific APIs.
+ void HandleSelectDownloadLocation(const base::ListValue* args);
+
// SelectFileDialog::Listener implementation.
void FileSelected(const base::FilePath& path,
int index,
void* params) override;
- // Callback for the "selectDownloadLocation" message. This will prompt the
- // user for a destination folder using platform-specific APIs.
- void HandleSelectDownloadLocation(const base::ListValue* args);
+ Profile* profile_;
+
+ PrefChangeRegistrar pref_registrar_;
scoped_refptr<ui::SelectFileDialog> select_folder_dialog_;
« no previous file with comments | « no previous file | chrome/browser/ui/webui/settings/downloads_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698