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 <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 12 matching lines...) Expand all Loading... |
23 } | 23 } |
24 | 24 |
25 namespace content { | 25 namespace content { |
26 class WebUI; | 26 class WebUI; |
27 } | 27 } |
28 | 28 |
29 namespace settings { | 29 namespace settings { |
30 | 30 |
31 // Chrome browser startup settings handler. | 31 // Chrome browser startup settings handler. |
32 class ClearBrowsingDataHandler : public SettingsPageUIHandler, | 32 class ClearBrowsingDataHandler : public SettingsPageUIHandler, |
33 public syncer::SyncServiceObserver { | 33 public sync_driver::SyncServiceObserver { |
34 public: | 34 public: |
35 explicit ClearBrowsingDataHandler(content::WebUI* webui); | 35 explicit ClearBrowsingDataHandler(content::WebUI* webui); |
36 ~ClearBrowsingDataHandler() override; | 36 ~ClearBrowsingDataHandler() override; |
37 | 37 |
38 // WebUIMessageHandler implementation. | 38 // WebUIMessageHandler implementation. |
39 void RegisterMessages() override; | 39 void RegisterMessages() override; |
40 void OnJavascriptAllowed() override; | 40 void OnJavascriptAllowed() override; |
41 void OnJavascriptDisallowed() override; | 41 void OnJavascriptDisallowed() override; |
42 | 42 |
43 private: | 43 private: |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 Profile* profile_; | 86 Profile* profile_; |
87 | 87 |
88 // Counters that calculate the data volume for individual data types. | 88 // Counters that calculate the data volume for individual data types. |
89 std::vector<std::unique_ptr<browsing_data::BrowsingDataCounter>> counters_; | 89 std::vector<std::unique_ptr<browsing_data::BrowsingDataCounter>> counters_; |
90 | 90 |
91 // Observes the currently active data clearing task. | 91 // Observes the currently active data clearing task. |
92 std::unique_ptr<TaskObserver> task_observer_; | 92 std::unique_ptr<TaskObserver> task_observer_; |
93 | 93 |
94 // ProfileSyncService to observe sync state changes. | 94 // ProfileSyncService to observe sync state changes. |
95 browser_sync::ProfileSyncService* sync_service_; | 95 browser_sync::ProfileSyncService* sync_service_; |
96 ScopedObserver<browser_sync::ProfileSyncService, syncer::SyncServiceObserver> | 96 ScopedObserver<browser_sync::ProfileSyncService, |
| 97 sync_driver::SyncServiceObserver> |
97 sync_service_observer_; | 98 sync_service_observer_; |
98 | 99 |
99 // Used to listen for pref changes to allow / disallow deleting browsing data. | 100 // Used to listen for pref changes to allow / disallow deleting browsing data. |
100 PrefChangeRegistrar profile_pref_registrar_; | 101 PrefChangeRegistrar profile_pref_registrar_; |
101 | 102 |
102 // Whether the sentence about other forms of history stored in user's account | 103 // Whether the sentence about other forms of history stored in user's account |
103 // should be displayed in the footer. This value is retrieved asynchronously, | 104 // should be displayed in the footer. This value is retrieved asynchronously, |
104 // so we cache it here. | 105 // so we cache it here. |
105 bool show_history_footer_; | 106 bool show_history_footer_; |
106 | 107 |
107 // Whether we should show a dialog informing the user about other forms of | 108 // Whether we should show a dialog informing the user about other forms of |
108 // history stored in their account after the history deletion is finished. | 109 // history stored in their account after the history deletion is finished. |
109 bool show_history_deletion_dialog_; | 110 bool show_history_deletion_dialog_; |
110 | 111 |
111 // A weak pointer factory for asynchronous calls referencing this class. | 112 // A weak pointer factory for asynchronous calls referencing this class. |
112 base::WeakPtrFactory<ClearBrowsingDataHandler> weak_ptr_factory_; | 113 base::WeakPtrFactory<ClearBrowsingDataHandler> weak_ptr_factory_; |
113 | 114 |
114 DISALLOW_COPY_AND_ASSIGN(ClearBrowsingDataHandler); | 115 DISALLOW_COPY_AND_ASSIGN(ClearBrowsingDataHandler); |
115 }; | 116 }; |
116 | 117 |
117 } // namespace settings | 118 } // namespace settings |
118 | 119 |
119 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_CLEAR_BROWSING_DATA_HANDLER
_H_ | 120 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_CLEAR_BROWSING_DATA_HANDLER
_H_ |
OLD | NEW |