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 "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" |
(...skipping 13 matching lines...) Expand all Loading... |
24 void InitializePage() override; | 24 void InitializePage() override; |
25 | 25 |
26 // WebUIMessageHandler implementation. | 26 // WebUIMessageHandler implementation. |
27 void RegisterMessages() override; | 27 void RegisterMessages() override; |
28 | 28 |
29 private: | 29 private: |
30 // Handlers of JS messages. | 30 // Handlers of JS messages. |
31 void HandleUpdateStorageInfo(const base::ListValue* unused_args); | 31 void HandleUpdateStorageInfo(const base::ListValue* unused_args); |
32 void HandleOpenDownloads(const base::ListValue* unused_args); | 32 void HandleOpenDownloads(const base::ListValue* unused_args); |
33 void HandleOpenArcStorage(const base::ListValue* unused_args); | 33 void HandleOpenArcStorage(const base::ListValue* unused_args); |
| 34 void HandleClearDriveCache(const base::ListValue* unused_args); |
34 | 35 |
35 // Requests updating disk space information. | 36 // Requests updating disk space information. |
36 void UpdateSizeStat(); | 37 void UpdateSizeStat(); |
37 | 38 |
38 // Callback to update the UI about disk space information. | 39 // Callback to update the UI about disk space information. |
39 void OnGetSizeStat(int64_t* total_size, int64_t* available_size); | 40 void OnGetSizeStat(int64_t* total_size, int64_t* available_size); |
40 | 41 |
41 // Requests updating the size of Downloads directory. | 42 // Requests updating the size of Downloads directory. |
42 void UpdateDownloadsSize(); | 43 void UpdateDownloadsSize(); |
43 | 44 |
44 // Callback to update the UI about the size of Downloads directory. | 45 // Callback to update the UI about the size of Downloads directory. |
45 void OnGetDownloadsSize(int64_t size); | 46 void OnGetDownloadsSize(int64_t size); |
46 | 47 |
| 48 // Requests updating the size of Drive Cache. |
| 49 void UpdateDriveCacheSize(); |
| 50 |
| 51 // Callback to update the UI about the size of Drive Cache. |
| 52 void OnGetDriveCacheSize(int64_t size); |
| 53 |
47 // Requests updating the space size used by Android apps and cache. | 54 // Requests updating the space size used by Android apps and cache. |
48 void UpdateArcSize(); | 55 void UpdateArcSize(); |
49 | 56 |
50 // Callback to update the UI about Android apps and cache. | 57 // Callback to update the UI about Android apps and cache. |
51 void OnGetArcSize(bool succeeded, arc::mojom::ApplicationsSizePtr size); | 58 void OnGetArcSize(bool succeeded, arc::mojom::ApplicationsSizePtr size); |
52 | 59 |
| 60 // Callback called when clearing Drive cache is done. |
| 61 void OnClearDriveCacheDone(bool success); |
| 62 |
53 base::WeakPtrFactory<StorageManagerHandler> weak_ptr_factory_; | 63 base::WeakPtrFactory<StorageManagerHandler> weak_ptr_factory_; |
54 | 64 |
55 DISALLOW_COPY_AND_ASSIGN(StorageManagerHandler); | 65 DISALLOW_COPY_AND_ASSIGN(StorageManagerHandler); |
56 }; | 66 }; |
57 | 67 |
58 } // namespace options | 68 } // namespace options |
59 } // namespace chromeos | 69 } // namespace chromeos |
60 | 70 |
61 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_STORAGE_MANAGER_HANDLER_H_ | 71 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_STORAGE_MANAGER_HANDLER_H_ |
OLD | NEW |