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

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/storage_manager_handler.h

Issue 2111043003: Storage manager: Show the disk usage of other users. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Set a fake size. 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 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
Dan Beam 2016/06/30 23:24:09 #include <stddef.h> #include <vector>
fukino 2016/06/30 23:59:03 Done. Included stdint.h for int64_t.
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "chrome/browser/ui/webui/options/options_ui.h" 10 #include "chrome/browser/ui/webui/options/options_ui.h"
11 #include "components/arc/storage_manager/arc_storage_manager.h" 11 #include "components/arc/storage_manager/arc_storage_manager.h"
12 #include "components/user_manager/user.h"
12 13
13 namespace chromeos { 14 namespace chromeos {
14 namespace options { 15 namespace options {
15 16
16 // Storage manager overlay page UI handler. 17 // Storage manager overlay page UI handler.
17 class StorageManagerHandler : public ::options::OptionsPageUIHandler { 18 class StorageManagerHandler : public ::options::OptionsPageUIHandler {
18 public: 19 public:
19 // Enumeration for device state about remaining space. These values must be 20 // Enumeration for device state about remaining space. These values must be
20 // kept in sync with options.StorageSpaceState in JS code. 21 // kept in sync with options.StorageSpaceState in JS code.
21 enum StorageSpaceState { 22 enum StorageSpaceState {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 59
59 // Callback to update the UI about the size of Drive Cache. 60 // Callback to update the UI about the size of Drive Cache.
60 void OnGetDriveCacheSize(int64_t size); 61 void OnGetDriveCacheSize(int64_t size);
61 62
62 // Requests updating the size of browsing data. 63 // Requests updating the size of browsing data.
63 void UpdateBrowsingDataSize(); 64 void UpdateBrowsingDataSize();
64 65
65 // Callback to update the UI about the size of browsing data. 66 // Callback to update the UI about the size of browsing data.
66 void OnGetBrowsingDataSize(bool is_site_data, int64_t size); 67 void OnGetBrowsingDataSize(bool is_site_data, int64_t size);
67 68
69 // Requests updating the total size of other users' data.
70 void UpdateOtherUsersSize();
71
72 // Callback to save the fetched user sizes and update the UI.
73 void OnGetOtherUserSize(bool success, int64_t size);
74
68 // Requests updating the space size used by Android apps and cache. 75 // Requests updating the space size used by Android apps and cache.
69 void UpdateArcSize(); 76 void UpdateArcSize();
70 77
71 // Callback to update the UI about Android apps and cache. 78 // Callback to update the UI about Android apps and cache.
72 void OnGetArcSize(bool succeeded, arc::mojom::ApplicationsSizePtr size); 79 void OnGetArcSize(bool succeeded, arc::mojom::ApplicationsSizePtr size);
73 80
74 // Callback called when clearing Drive cache is done. 81 // Callback called when clearing Drive cache is done.
75 void OnClearDriveCacheDone(bool success); 82 void OnClearDriveCacheDone(bool success);
76 83
77 // Total size of cache data in browsing data. 84 // Total size of cache data in browsing data.
78 int64_t browser_cache_size_; 85 int64_t browser_cache_size_;
79 86
80 // Total size of site data in browsing data. 87 // Total size of site data in browsing data.
81 int64_t browser_site_data_size_; 88 int64_t browser_site_data_size_;
82 89
90 // The list of other users whose directory sizes will be accumulated as the
91 // size of "Other users".
92 user_manager::UserList other_users_;
93
94 // Fetched sizes of user directories.
95 std::vector<int64_t> user_sizes_;
96
83 base::WeakPtrFactory<StorageManagerHandler> weak_ptr_factory_; 97 base::WeakPtrFactory<StorageManagerHandler> weak_ptr_factory_;
84 98
85 DISALLOW_COPY_AND_ASSIGN(StorageManagerHandler); 99 DISALLOW_COPY_AND_ASSIGN(StorageManagerHandler);
86 }; 100 };
87 101
88 } // namespace options 102 } // namespace options
89 } // namespace chromeos 103 } // namespace chromeos
90 104
91 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_STORAGE_MANAGER_HANDLER_H_ 105 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_STORAGE_MANAGER_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698