| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_OPTIONS_CLEAR_BROWSER_DATA_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_CLEAR_BROWSER_DATA_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CLEAR_BROWSER_DATA_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CLEAR_BROWSER_DATA_HANDLER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "chrome/browser/browsing_data/browsing_data_remover.h" | |
| 13 #include "chrome/browser/ui/webui/options/options_ui.h" | 12 #include "chrome/browser/ui/webui/options/options_ui.h" |
| 14 #include "components/browser_sync/profile_sync_service.h" | 13 #include "components/browser_sync/profile_sync_service.h" |
| 15 #include "components/browsing_data/core/counters/browsing_data_counter.h" | 14 #include "components/browsing_data/core/counters/browsing_data_counter.h" |
| 16 #include "components/prefs/pref_member.h" | 15 #include "components/prefs/pref_member.h" |
| 16 #include "content/public/browser/browsing_data_remover.h" |
| 17 | 17 |
| 18 namespace options { | 18 namespace options { |
| 19 | 19 |
| 20 // Clear browser data handler page UI handler. | 20 // Clear browser data handler page UI handler. |
| 21 class ClearBrowserDataHandler : public OptionsPageUIHandler, | 21 class ClearBrowserDataHandler : public OptionsPageUIHandler, |
| 22 public BrowsingDataRemover::Observer, | 22 public content::BrowsingDataRemover::Observer, |
| 23 public syncer::SyncServiceObserver { | 23 public syncer::SyncServiceObserver { |
| 24 public: | 24 public: |
| 25 ClearBrowserDataHandler(); | 25 ClearBrowserDataHandler(); |
| 26 ~ClearBrowserDataHandler() override; | 26 ~ClearBrowserDataHandler() override; |
| 27 | 27 |
| 28 // OptionsPageUIHandler implementation. | 28 // OptionsPageUIHandler implementation. |
| 29 void GetLocalizedValues(base::DictionaryValue* localized_strings) override; | 29 void GetLocalizedValues(base::DictionaryValue* localized_strings) override; |
| 30 void InitializeHandler() override; | 30 void InitializeHandler() override; |
| 31 void InitializePage() override; | 31 void InitializePage() override; |
| 32 | 32 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 void RefreshHistoryNotice(); | 69 void RefreshHistoryNotice(); |
| 70 | 70 |
| 71 // Shows or hides the notice about other forms of browsing history. | 71 // Shows or hides the notice about other forms of browsing history. |
| 72 void UpdateHistoryNotice(bool show); | 72 void UpdateHistoryNotice(bool show); |
| 73 | 73 |
| 74 // Remembers whether we should popup a dialog about other forms of browsing | 74 // Remembers whether we should popup a dialog about other forms of browsing |
| 75 // history when the user deletes the history for the first time. | 75 // history when the user deletes the history for the first time. |
| 76 void UpdateHistoryDeletionDialog(bool show); | 76 void UpdateHistoryDeletionDialog(bool show); |
| 77 | 77 |
| 78 // If non-null it means removal is in progress. | 78 // If non-null it means removal is in progress. |
| 79 BrowsingDataRemover* remover_; | 79 content::BrowsingDataRemover* remover_; |
| 80 | 80 |
| 81 // Keeps track of whether clearing LSO data is supported. | 81 // Keeps track of whether clearing LSO data is supported. |
| 82 BooleanPrefMember clear_plugin_lso_data_enabled_; | 82 BooleanPrefMember clear_plugin_lso_data_enabled_; |
| 83 | 83 |
| 84 // Keeps track of whether deleting browsing history and downloads is allowed. | 84 // Keeps track of whether deleting browsing history and downloads is allowed. |
| 85 BooleanPrefMember allow_deleting_browser_history_; | 85 BooleanPrefMember allow_deleting_browser_history_; |
| 86 | 86 |
| 87 // Counters that calculate the data volume for some of the data types. | 87 // Counters that calculate the data volume for some of the data types. |
| 88 std::vector<std::unique_ptr<browsing_data::BrowsingDataCounter>> counters_; | 88 std::vector<std::unique_ptr<browsing_data::BrowsingDataCounter>> counters_; |
| 89 | 89 |
| 90 // Informs us whether the user is syncing their data. | 90 // Informs us whether the user is syncing their data. |
| 91 browser_sync::ProfileSyncService* sync_service_; | 91 browser_sync::ProfileSyncService* sync_service_; |
| 92 | 92 |
| 93 // Whether we should show a notice about other forms of browsing history. | 93 // Whether we should show a notice about other forms of browsing history. |
| 94 bool should_show_history_notice_; | 94 bool should_show_history_notice_; |
| 95 | 95 |
| 96 // Whether we should popup a dialog about other forms of browsing history | 96 // Whether we should popup a dialog about other forms of browsing history |
| 97 // when the user deletes their browsing history for the first time. | 97 // when the user deletes their browsing history for the first time. |
| 98 bool should_show_history_deletion_dialog_; | 98 bool should_show_history_deletion_dialog_; |
| 99 | 99 |
| 100 // A weak pointer factory for asynchronous calls referencing this class. | 100 // A weak pointer factory for asynchronous calls referencing this class. |
| 101 base::WeakPtrFactory<ClearBrowserDataHandler> weak_ptr_factory_; | 101 base::WeakPtrFactory<ClearBrowserDataHandler> weak_ptr_factory_; |
| 102 | 102 |
| 103 DISALLOW_COPY_AND_ASSIGN(ClearBrowserDataHandler); | 103 DISALLOW_COPY_AND_ASSIGN(ClearBrowserDataHandler); |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 } // namespace options | 106 } // namespace options |
| 107 | 107 |
| 108 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CLEAR_BROWSER_DATA_HANDLER_H_ | 108 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CLEAR_BROWSER_DATA_HANDLER_H_ |
| OLD | NEW |