Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_SITE_SETTINGS_HANDLER_H_ | |
| 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_SITE_SETTINGS_HANDLER_H_ | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "chrome/browser/storage/storage_info_fetcher.h" | |
| 11 #include "chrome/browser/ui/webui/settings/md_settings_ui.h" | |
| 12 | |
| 13 class Profile; | |
| 14 | |
| 15 namespace base { | |
| 16 class Value; | |
|
michaelpg
2016/01/27 18:42:48
ListValue
Finnur
2016/01/28 11:17:49
Done.
| |
| 17 } | |
| 18 | |
| 19 namespace settings { | |
| 20 | |
| 21 // Chrome "ContentSettings" settings page UI handler. | |
| 22 class SiteSettingsHandler | |
| 23 : public SettingsPageUIHandler, StorageInfoFetcher::Observer { | |
| 24 public: | |
| 25 explicit SiteSettingsHandler(Profile* profile); | |
| 26 ~SiteSettingsHandler() override; | |
| 27 | |
| 28 // SettingsPageUIHandler: | |
| 29 void RegisterMessages() override; | |
| 30 | |
| 31 // StorageInfoFetcher::Observer: | |
| 32 void OnGetUsageInfo(const storage::UsageInfoEntries& entries) override; | |
| 33 | |
| 34 private: | |
| 35 // Asynchronously fetches the usage for a given origin. Replies back with | |
| 36 // OnGetUsageInfo above. | |
| 37 void HandleFetchUsageTotal(const base::ListValue* args); | |
| 38 | |
| 39 Profile* profile_; | |
| 40 | |
| 41 // The host for which to fetch usage. | |
| 42 std::string usage_host_; | |
| 43 | |
| 44 // The helper object asynchronously fetching storage info. | |
| 45 scoped_refptr<StorageInfoFetcher> storage_info_fetcher_; | |
| 46 | |
| 47 DISALLOW_COPY_AND_ASSIGN(SiteSettingsHandler); | |
| 48 }; | |
| 49 | |
| 50 } // namespace settings | |
| 51 | |
| 52 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SITE_SETTINGS_HANDLER_H_ | |
| OLD | NEW |