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 <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/scoped_observer.h" | 12 #include "base/scoped_observer.h" |
13 #include "chrome/browser/browsing_data/browsing_data_counter.h" | |
14 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 13 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
15 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" | 15 #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" |
17 #include "components/browser_sync/browser/profile_sync_service.h" | 16 #include "components/browser_sync/browser/profile_sync_service.h" |
| 17 #include "components/browsing_data/counters/browsing_data_counter.h" |
18 #include "components/prefs/pref_change_registrar.h" | 18 #include "components/prefs/pref_change_registrar.h" |
19 | 19 |
20 namespace base { | 20 namespace base { |
21 class ListValue; | 21 class ListValue; |
22 } | 22 } |
23 | 23 |
24 namespace content { | 24 namespace content { |
25 class WebUI; | 25 class WebUI; |
26 } | 26 } |
27 | 27 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 // Finds out whether we should show notice about other forms of history stored | 61 // Finds out whether we should show notice about other forms of history stored |
62 // in user's account. | 62 // in user's account. |
63 void RefreshHistoryNotice(); | 63 void RefreshHistoryNotice(); |
64 | 64 |
65 // Called as an asynchronous response to |RefreshHistoryNotice()|. Shows or | 65 // Called as an asynchronous response to |RefreshHistoryNotice()|. Shows or |
66 // hides the footer about other forms of history stored in user's account. | 66 // hides the footer about other forms of history stored in user's account. |
67 void UpdateHistoryNotice(bool show); | 67 void UpdateHistoryNotice(bool show); |
68 | 68 |
69 // Adds a browsing data |counter|. | 69 // Adds a browsing data |counter|. |
70 void AddCounter(std::unique_ptr<BrowsingDataCounter> counter); | 70 void AddCounter(std::unique_ptr<browsing_data::BrowsingDataCounter> counter); |
71 | 71 |
72 // Updates a counter text according to the |result|. | 72 // Updates a counter text according to the |result|. |
73 void UpdateCounterText(std::unique_ptr<BrowsingDataCounter::Result> result); | 73 void UpdateCounterText( |
| 74 std::unique_ptr<browsing_data::BrowsingDataCounter::Result> result); |
74 | 75 |
75 // Cached profile corresponding to the WebUI of this handler. | 76 // Cached profile corresponding to the WebUI of this handler. |
76 Profile* profile_; | 77 Profile* profile_; |
77 | 78 |
78 // Counters that calculate the data volume for individual data types. | 79 // Counters that calculate the data volume for individual data types. |
79 std::vector<std::unique_ptr<BrowsingDataCounter>> counters_; | 80 std::vector<std::unique_ptr<browsing_data::BrowsingDataCounter>> counters_; |
80 | 81 |
81 // ProfileSyncService to observe sync state changes. | 82 // ProfileSyncService to observe sync state changes. |
82 ProfileSyncService* sync_service_; | 83 ProfileSyncService* sync_service_; |
83 ScopedObserver<ProfileSyncService, sync_driver::SyncServiceObserver> | 84 ScopedObserver<ProfileSyncService, sync_driver::SyncServiceObserver> |
84 sync_service_observer_; | 85 sync_service_observer_; |
85 | 86 |
86 // If non-null it means removal is in progress. | 87 // If non-null it means removal is in progress. |
87 BrowsingDataRemover* remover_; | 88 BrowsingDataRemover* remover_; |
88 | 89 |
89 // The WebUI callback ID of the last performClearBrowserData request. There | 90 // The WebUI callback ID of the last performClearBrowserData request. There |
(...skipping 10 matching lines...) Expand all Loading... |
100 | 101 |
101 // A weak pointer factory for asynchronous calls referencing this class. | 102 // A weak pointer factory for asynchronous calls referencing this class. |
102 base::WeakPtrFactory<ClearBrowsingDataHandler> weak_ptr_factory_; | 103 base::WeakPtrFactory<ClearBrowsingDataHandler> weak_ptr_factory_; |
103 | 104 |
104 DISALLOW_COPY_AND_ASSIGN(ClearBrowsingDataHandler); | 105 DISALLOW_COPY_AND_ASSIGN(ClearBrowsingDataHandler); |
105 }; | 106 }; |
106 | 107 |
107 } // namespace settings | 108 } // namespace settings |
108 | 109 |
109 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_CLEAR_BROWSING_DATA_HANDLER
_H_ | 110 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_CLEAR_BROWSING_DATA_HANDLER
_H_ |
OLD | NEW |