| Index: chrome/browser/ui/webui/options/chromeos/storage_manager_handler.h
|
| diff --git a/chrome/browser/ui/webui/options/chromeos/storage_manager_handler.h b/chrome/browser/ui/webui/options/chromeos/storage_manager_handler.h
|
| index c6e1629ba246801caa905d954fdc57b6db53c207..07d3b74e3c86c3c348097ac0d695b108a2875e3d 100644
|
| --- a/chrome/browser/ui/webui/options/chromeos/storage_manager_handler.h
|
| +++ b/chrome/browser/ui/webui/options/chromeos/storage_manager_handler.h
|
| @@ -7,10 +7,13 @@
|
|
|
| #include <stdint.h>
|
|
|
| +#include <map>
|
| +#include <memory>
|
| #include <vector>
|
|
|
| #include "base/macros.h"
|
| #include "base/memory/weak_ptr.h"
|
| +#include "chrome/browser/browsing_data/site_data_size_collector.h"
|
| #include "chrome/browser/ui/webui/options/options_ui.h"
|
| #include "components/arc/storage_manager/arc_storage_manager.h"
|
| #include "components/user_manager/user.h"
|
| @@ -40,6 +43,13 @@ class StorageManagerHandler : public ::options::OptionsPageUIHandler {
|
| void RegisterMessages() override;
|
|
|
| private:
|
| + // Enumlation for types of browsing data which we aocunt.
|
| + enum BrowsingDataType {
|
| + BROWSING_DATA_TYPE_HTTP_CACHE = 0,
|
| + BROWSING_DATA_TYPE_SITE_DATA,
|
| + BROWSING_DATA_TYPE_MAX
|
| + };
|
| +
|
| // Handlers of JS messages.
|
| void HandleUpdateStorageInfo(const base::ListValue* unused_args);
|
| void HandleOpenDownloads(const base::ListValue* unused_args);
|
| @@ -68,7 +78,7 @@ class StorageManagerHandler : public ::options::OptionsPageUIHandler {
|
| void UpdateBrowsingDataSize();
|
|
|
| // Callback to update the UI about the size of browsing data.
|
| - void OnGetBrowsingDataSize(bool is_site_data, int64_t size);
|
| + void OnGetBrowsingDataSize(BrowsingDataType, int64_t size);
|
|
|
| // Requests updating the total size of other users' data.
|
| void UpdateOtherUsersSize();
|
| @@ -85,11 +95,8 @@ class StorageManagerHandler : public ::options::OptionsPageUIHandler {
|
| // Callback called when clearing Drive cache is done.
|
| void OnClearDriveCacheDone(bool success);
|
|
|
| - // Total size of cache data in browsing data.
|
| - int64_t browser_cache_size_;
|
| -
|
| - // Total size of site data in browsing data.
|
| - int64_t browser_site_data_size_;
|
| + // Map to store fetched size of browsing data.
|
| + std::map<BrowsingDataType, int64_t> browsing_data_size_;
|
|
|
| // The list of other users whose directory sizes will be accumulated as the
|
| // size of "Other users".
|
| @@ -98,6 +105,9 @@ class StorageManagerHandler : public ::options::OptionsPageUIHandler {
|
| // Fetched sizes of user directories.
|
| std::vector<int64_t> user_sizes_;
|
|
|
| + // Helper to compute the total size of all types of site date.
|
| + std::unique_ptr<SiteDataSizeCollector> site_data_size_collector_;
|
| +
|
| base::WeakPtrFactory<StorageManagerHandler> weak_ptr_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(StorageManagerHandler);
|
|
|