| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_CLEAR_BROWSING_DATA_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_CLEAR_BROWSING_DATA_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_CLEAR_BROWSING_DATA_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_CLEAR_BROWSING_DATA_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 10 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 class ClearBrowsingDataHandler : public SettingsPageUIHandler, | 26 class ClearBrowsingDataHandler : public SettingsPageUIHandler, |
| 27 public BrowsingDataRemover::Observer { | 27 public BrowsingDataRemover::Observer { |
| 28 public: | 28 public: |
| 29 explicit ClearBrowsingDataHandler(content::WebUI* webui); | 29 explicit ClearBrowsingDataHandler(content::WebUI* webui); |
| 30 ~ClearBrowsingDataHandler() override; | 30 ~ClearBrowsingDataHandler() override; |
| 31 | 31 |
| 32 // OptionsPageUIHandler: | 32 // OptionsPageUIHandler: |
| 33 void RegisterMessages() override; | 33 void RegisterMessages() override; |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 // Javascript callback to start clearing data. | 36 // Clears browsing data, called by Javascript. |
| 37 void HandleClearBrowserData(const base::ListValue* value); | 37 void HandleClearBrowsingData(const base::ListValue* value); |
| 38 | 38 |
| 39 // BrowsingDataRemover::Observer implementation. | 39 // BrowsingDataRemover::Observer implementation. |
| 40 // Re-enables clear button once all requested data has been removed. | 40 // Re-enables clear button once all requested data has been removed. |
| 41 void OnBrowsingDataRemoverDone() override; | 41 void OnBrowsingDataRemoverDone() override; |
| 42 | 42 |
| 43 // Updates UI when the pref to allow clearing history changes. | 43 // Updates UI when the pref to allow clearing history changes. |
| 44 virtual void OnBrowsingHistoryPrefChanged(); | 44 virtual void OnBrowsingHistoryPrefChanged(); |
| 45 | 45 |
| 46 // If non-null it means removal is in progress. | 46 // If non-null it means removal is in progress. |
| 47 BrowsingDataRemover* remover_; | 47 BrowsingDataRemover* remover_; |
| 48 | 48 |
| 49 // The WebUI callback ID of the last performClearBrowserData request. There |
| 50 // can only be one such request in-flight. |
| 51 std::string webui_callback_id_; |
| 52 |
| 49 // Keeps track of whether clearing LSO data is supported. | 53 // Keeps track of whether clearing LSO data is supported. |
| 50 BooleanPrefMember clear_plugin_lso_data_enabled_; | 54 BooleanPrefMember clear_plugin_lso_data_enabled_; |
| 51 | 55 |
| 52 // Keeps track of whether Pepper Flash is enabled and thus Flapper-specific | 56 // Keeps track of whether Pepper Flash is enabled and thus Flapper-specific |
| 53 // settings and removal options (e.g. Content Licenses) are available. | 57 // settings and removal options (e.g. Content Licenses) are available. |
| 54 BooleanPrefMember pepper_flash_settings_enabled_; | 58 BooleanPrefMember pepper_flash_settings_enabled_; |
| 55 | 59 |
| 56 // Keeps track of whether deleting browsing history and downloads is allowed. | 60 // Keeps track of whether deleting browsing history and downloads is allowed. |
| 57 BooleanPrefMember allow_deleting_browser_history_; | 61 BooleanPrefMember allow_deleting_browser_history_; |
| 58 | 62 |
| 59 DISALLOW_COPY_AND_ASSIGN(ClearBrowsingDataHandler); | 63 DISALLOW_COPY_AND_ASSIGN(ClearBrowsingDataHandler); |
| 60 }; | 64 }; |
| 61 | 65 |
| 62 } // namespace settings | 66 } // namespace settings |
| 63 | 67 |
| 64 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_CLEAR_BROWSING_DATA_HANDLER
_H_ | 68 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_CLEAR_BROWSING_DATA_HANDLER
_H_ |
| OLD | NEW |