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

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

Issue 2041343002: Storage manager: Show overall size information and size of Downloads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments and rebase on top of https://codereview.chromium.org/1995113002. Created 4 years, 6 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
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/weak_ptr.h"
9 #include "chrome/browser/ui/webui/options/options_ui.h" 10 #include "chrome/browser/ui/webui/options/options_ui.h"
10 11
11 namespace chromeos { 12 namespace chromeos {
12 namespace options { 13 namespace options {
13 14
14 // Storage manager overlay page UI handler. 15 // Storage manager overlay page UI handler.
15 class StorageManagerHandler : public ::options::OptionsPageUIHandler { 16 class StorageManagerHandler : public ::options::OptionsPageUIHandler {
16 public: 17 public:
17 StorageManagerHandler(); 18 StorageManagerHandler();
18 ~StorageManagerHandler() override; 19 ~StorageManagerHandler() override;
19 20
20 // OptionsPageUIHandler implementation. 21 // OptionsPageUIHandler implementation.
21 void GetLocalizedValues(base::DictionaryValue* localized_strings) override; 22 void GetLocalizedValues(base::DictionaryValue* localized_strings) override;
22 void InitializePage() override; 23 void InitializePage() override;
23 24
24 // WebUIMessageHandler implementation. 25 // WebUIMessageHandler implementation.
25 void RegisterMessages() override; 26 void RegisterMessages() override;
26 27
27 private: 28 private:
29 // Handlers of JS messages.
30 void HandleUpdateStorageInfo(const base::ListValue* unused_args);
31 void HandleOpenDownloads(const base::ListValue* unused_args);
32
33 // Requests updating disk space information.
34 void UpdateSizeStat();
35
36 // Callback to update the UI about disk space information.
37 void OnGetSizeStat(int64_t* total_size, int64_t* available_size);
38
39 // Requests updating the size of Downloads directory.
40 void UpdateDownloadsSize();
41
42 // Callback to update the UI about the size of Downloads directory.
43 void OnGetDownloadsSize(int64_t size);
44
45 base::WeakPtrFactory<StorageManagerHandler> weak_ptr_factory_;
46
28 DISALLOW_COPY_AND_ASSIGN(StorageManagerHandler); 47 DISALLOW_COPY_AND_ASSIGN(StorageManagerHandler);
29 }; 48 };
30 49
31 } // namespace options 50 } // namespace options
32 } // namespace chromeos 51 } // namespace chromeos
33 52
34 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_STORAGE_MANAGER_HANDLER_H_ 53 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_STORAGE_MANAGER_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698