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

Side by Side Diff: chrome/browser/ui/webui/quota_internals_handler.h

Issue 7084024: Add chrome://quota-internals/ (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: '' Created 9 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 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_QUOTA_INTERNALS_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_QUOTA_INTERNALS_HANDLER_H_
7 #pragma once
8
9 #include <map>
10 #include <string>
11 #include <vector>
12
13 #include "base/memory/ref_counted.h"
14 #include "content/browser/webui/web_ui.h"
15 #include "webkit/quota/quota_types.h"
16
17 class Value;
18 class ListValue;
19
20 namespace quota_internals {
21
22 class QuotaInternalsProxy;
23 class GlobalData;
24 class HostData;
25 class OriginData;
26 typedef std::map<std::string, std::string> Statistics;
27
28 // This class handles message from WebUI page of chrome://quota-internals/.
29 // All methods in this class can be called on UI thread.
kinuko 2011/07/04 08:24:27 nit: 'can be' or 'should be'?
tzik 2011/07/06 22:49:04 Done.
30 class QuotaInternalsHandler : public WebUIMessageHandler {
31 public:
32 QuotaInternalsHandler();
33 virtual ~QuotaInternalsHandler();
34 virtual void RegisterMessages() OVERRIDE;
35
36 // Called by QuotaInternalsProxy to report information to WebUI page.
37 void ReportAvailableSpace(int64 available_space);
38 void ReportGlobalData(const GlobalData& data);
39 void ReportHostData(const std::vector<HostData>& hosts);
40 void ReportOriginData(const std::vector<OriginData>& origins);
41 void ReportStatistics(const Statistics& stats);
42
43 private:
44 void OnRequestData(const ListValue*);
45 void SendMessage(const std::string& message, const Value& value);
46
47 scoped_refptr<QuotaInternalsProxy> proxy_;
48
49 DISALLOW_COPY_AND_ASSIGN(QuotaInternalsHandler);
50 };
51
52 } // quota_internals
53
54 #endif // CHROME_BROWSER_UI_WEBUI_QUOTA_INTERNALS_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698