Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.h

Issue 2084903002: Moved BrowsingDataCounter and part of BrowsingDataCounterUtils to components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // Called as an asynchronous response to |RefreshHistoryNotice()|. Enables or 69 // Called as an asynchronous response to |RefreshHistoryNotice()|. Enables or
70 // disables the dialog about other forms of history stored in user's account 70 // disables the dialog about other forms of history stored in user's account
71 // that is shown when the history deletion is finished. 71 // that is shown when the history deletion is finished.
72 void UpdateHistoryDeletionDialog(bool show); 72 void UpdateHistoryDeletionDialog(bool show);
73 73
74 // Adds a browsing data |counter|. 74 // Adds a browsing data |counter|.
75 void AddCounter(std::unique_ptr<BrowsingDataCounter> counter); 75 void AddCounter(std::unique_ptr<browsing_data::BrowsingDataCounter> counter);
76 76
77 // Updates a counter text according to the |result|. 77 // Updates a counter text according to the |result|.
78 void UpdateCounterText(std::unique_ptr<BrowsingDataCounter::Result> result); 78 void UpdateCounterText(
79 std::unique_ptr<browsing_data::BrowsingDataCounter::Result> result);
79 80
80 // Cached profile corresponding to the WebUI of this handler. 81 // Cached profile corresponding to the WebUI of this handler.
81 Profile* profile_; 82 Profile* profile_;
82 83
83 // Counters that calculate the data volume for individual data types. 84 // Counters that calculate the data volume for individual data types.
84 std::vector<std::unique_ptr<BrowsingDataCounter>> counters_; 85 std::vector<std::unique_ptr<browsing_data::BrowsingDataCounter>> counters_;
85 86
86 // ProfileSyncService to observe sync state changes. 87 // ProfileSyncService to observe sync state changes.
87 ProfileSyncService* sync_service_; 88 ProfileSyncService* sync_service_;
88 ScopedObserver<ProfileSyncService, sync_driver::SyncServiceObserver> 89 ScopedObserver<ProfileSyncService, sync_driver::SyncServiceObserver>
89 sync_service_observer_; 90 sync_service_observer_;
90 91
91 // If non-null it means removal is in progress. 92 // If non-null it means removal is in progress.
92 BrowsingDataRemover* remover_; 93 BrowsingDataRemover* remover_;
93 94
94 // The WebUI callback ID of the last performClearBrowserData request. There 95 // The WebUI callback ID of the last performClearBrowserData request. There
(...skipping 14 matching lines...) Expand all
109 110
110 // A weak pointer factory for asynchronous calls referencing this class. 111 // A weak pointer factory for asynchronous calls referencing this class.
111 base::WeakPtrFactory<ClearBrowsingDataHandler> weak_ptr_factory_; 112 base::WeakPtrFactory<ClearBrowsingDataHandler> weak_ptr_factory_;
112 113
113 DISALLOW_COPY_AND_ASSIGN(ClearBrowsingDataHandler); 114 DISALLOW_COPY_AND_ASSIGN(ClearBrowsingDataHandler);
114 }; 115 };
115 116
116 } // namespace settings 117 } // namespace settings
117 118
118 #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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698