| 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 sync_driver::SyncServiceObserver { | 33                                  public syncer::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, | 96   ScopedObserver<browser_sync::ProfileSyncService, syncer::SyncServiceObserver> | 
| 97                  sync_driver::SyncServiceObserver> |  | 
| 98       sync_service_observer_; | 97       sync_service_observer_; | 
| 99 | 98 | 
| 100   // Used to listen for pref changes to allow / disallow deleting browsing data. | 99   // Used to listen for pref changes to allow / disallow deleting browsing data. | 
| 101   PrefChangeRegistrar profile_pref_registrar_; | 100   PrefChangeRegistrar profile_pref_registrar_; | 
| 102 | 101 | 
| 103   // Whether the sentence about other forms of history stored in user's account | 102   // Whether the sentence about other forms of history stored in user's account | 
| 104   // should be displayed in the footer. This value is retrieved asynchronously, | 103   // should be displayed in the footer. This value is retrieved asynchronously, | 
| 105   // so we cache it here. | 104   // so we cache it here. | 
| 106   bool show_history_footer_; | 105   bool show_history_footer_; | 
| 107 | 106 | 
| 108   // Whether we should show a dialog informing the user about other forms of | 107   // Whether we should show a dialog informing the user about other forms of | 
| 109   // history stored in their account after the history deletion is finished. | 108   // history stored in their account after the history deletion is finished. | 
| 110   bool show_history_deletion_dialog_; | 109   bool show_history_deletion_dialog_; | 
| 111 | 110 | 
| 112   // A weak pointer factory for asynchronous calls referencing this class. | 111   // A weak pointer factory for asynchronous calls referencing this class. | 
| 113   base::WeakPtrFactory<ClearBrowsingDataHandler> weak_ptr_factory_; | 112   base::WeakPtrFactory<ClearBrowsingDataHandler> weak_ptr_factory_; | 
| 114 | 113 | 
| 115   DISALLOW_COPY_AND_ASSIGN(ClearBrowsingDataHandler); | 114   DISALLOW_COPY_AND_ASSIGN(ClearBrowsingDataHandler); | 
| 116 }; | 115 }; | 
| 117 | 116 | 
| 118 }  // namespace settings | 117 }  // namespace settings | 
| 119 | 118 | 
| 120 #endif  // CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_CLEAR_BROWSING_DATA_HANDLER
     _H_ | 119 #endif  // CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_CLEAR_BROWSING_DATA_HANDLER
     _H_ | 
| OLD | NEW | 
|---|