1 // Copyright (c) 2012 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_OPTIONS_CLEAR_BROWSER_DATA_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CLEAR_BROWSER_DATA_HANDLER_H_
8 #include "base/prefs/pref_member.h"
9 #include "chrome/browser/browsing_data/browsing_data_remover.h"
10 #include "chrome/browser/ui/webui/options/options_ui.h"
14 // Clear browser data handler page UI handler.
15 class ClearBrowserDataHandler
: public OptionsPageUIHandler
,
16 public BrowsingDataRemover::Observer
{
18 ClearBrowserDataHandler();
19 ~ClearBrowserDataHandler() override
;
21 // OptionsPageUIHandler implementation.
22 void GetLocalizedValues(base::DictionaryValue
* localized_strings
) override
;
23 void InitializeHandler() override
;
24 void InitializePage() override
;
26 // WebUIMessageHandler implementation.
27 void RegisterMessages() override
;
29 void UpdateInfoBannerVisibility();
32 // Javascript callback to start clearing data.
33 void HandleClearBrowserData(const base::ListValue
* value
);
35 // BrowsingDataRemover::Observer implementation.
36 // Closes the dialog once all requested data has been removed.
37 void OnBrowsingDataRemoverDone() override
;
39 // Updates UI when the pref to allow clearing history changes.
40 virtual void OnBrowsingHistoryPrefChanged();
42 // If non-null it means removal is in progress. BrowsingDataRemover takes care
43 // of deleting itself when done.
44 BrowsingDataRemover
* remover_
;
46 // Keeps track of whether clearing LSO data is supported.
47 BooleanPrefMember clear_plugin_lso_data_enabled_
;
49 // Keeps track of whether Pepper Flash is enabled and thus Flapper-specific
50 // settings and removal options (e.g. Content Licenses) are available.
51 BooleanPrefMember pepper_flash_settings_enabled_
;
53 // Keeps track of whether deleting browsing history and downloads is allowed.
54 BooleanPrefMember allow_deleting_browser_history_
;
56 DISALLOW_COPY_AND_ASSIGN(ClearBrowserDataHandler
);
59 } // namespace options
61 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CLEAR_BROWSER_DATA_HANDLER_H_