| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_OPTIONS_CHROMEOS_STORAGE_MANAGER_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_STORAGE_MANAGER_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_STORAGE_MANAGER_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_STORAGE_MANAGER_HANDLER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> |
| 10 #include <vector> | 11 #include <vector> |
| 11 | 12 |
| 12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 13 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "chrome/browser/browsing_data/site_data_size_collector.h" |
| 14 #include "chrome/browser/ui/webui/options/options_ui.h" | 16 #include "chrome/browser/ui/webui/options/options_ui.h" |
| 15 #include "components/arc/storage_manager/arc_storage_manager.h" | 17 #include "components/arc/storage_manager/arc_storage_manager.h" |
| 16 #include "components/user_manager/user.h" | 18 #include "components/user_manager/user.h" |
| 17 | 19 |
| 18 namespace chromeos { | 20 namespace chromeos { |
| 19 namespace options { | 21 namespace options { |
| 20 | 22 |
| 21 // Storage manager overlay page UI handler. | 23 // Storage manager overlay page UI handler. |
| 22 class StorageManagerHandler : public ::options::OptionsPageUIHandler { | 24 class StorageManagerHandler : public ::options::OptionsPageUIHandler { |
| 23 public: | 25 public: |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 83 |
| 82 // Callback to update the UI about Android apps and cache. | 84 // Callback to update the UI about Android apps and cache. |
| 83 void OnGetArcSize(bool succeeded, arc::mojom::ApplicationsSizePtr size); | 85 void OnGetArcSize(bool succeeded, arc::mojom::ApplicationsSizePtr size); |
| 84 | 86 |
| 85 // Callback called when clearing Drive cache is done. | 87 // Callback called when clearing Drive cache is done. |
| 86 void OnClearDriveCacheDone(bool success); | 88 void OnClearDriveCacheDone(bool success); |
| 87 | 89 |
| 88 // Total size of cache data in browsing data. | 90 // Total size of cache data in browsing data. |
| 89 int64_t browser_cache_size_; | 91 int64_t browser_cache_size_; |
| 90 | 92 |
| 93 // True if we have already received the size of http cache. |
| 94 bool has_browser_cache_size_; |
| 95 |
| 91 // Total size of site data in browsing data. | 96 // Total size of site data in browsing data. |
| 92 int64_t browser_site_data_size_; | 97 int64_t browser_site_data_size_; |
| 93 | 98 |
| 99 // True if we have already received the size of site data. |
| 100 bool has_browser_site_data_size_; |
| 101 |
| 94 // The list of other users whose directory sizes will be accumulated as the | 102 // The list of other users whose directory sizes will be accumulated as the |
| 95 // size of "Other users". | 103 // size of "Other users". |
| 96 user_manager::UserList other_users_; | 104 user_manager::UserList other_users_; |
| 97 | 105 |
| 98 // Fetched sizes of user directories. | 106 // Fetched sizes of user directories. |
| 99 std::vector<int64_t> user_sizes_; | 107 std::vector<int64_t> user_sizes_; |
| 100 | 108 |
| 109 // Helper to compute the total size of all types of site date. |
| 110 std::unique_ptr<SiteDataSizeCollector> site_data_size_collector_; |
| 111 |
| 101 base::WeakPtrFactory<StorageManagerHandler> weak_ptr_factory_; | 112 base::WeakPtrFactory<StorageManagerHandler> weak_ptr_factory_; |
| 102 | 113 |
| 103 DISALLOW_COPY_AND_ASSIGN(StorageManagerHandler); | 114 DISALLOW_COPY_AND_ASSIGN(StorageManagerHandler); |
| 104 }; | 115 }; |
| 105 | 116 |
| 106 } // namespace options | 117 } // namespace options |
| 107 } // namespace chromeos | 118 } // namespace chromeos |
| 108 | 119 |
| 109 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_STORAGE_MANAGER_HANDLER_H_ | 120 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_STORAGE_MANAGER_HANDLER_H_ |
| OLD | NEW |