OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 #include "chrome/browser/ui/webui/quota_internals/quota_internals_handler.h" | 5 #include "chrome/browser/ui/webui/quota_internals/quota_internals_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 for (iterator itr(stats.begin()); itr != stats.end(); ++itr) { | 70 for (iterator itr(stats.begin()); itr != stats.end(); ++itr) { |
71 dict.SetString(itr->first, itr->second); | 71 dict.SetString(itr->first, itr->second); |
72 } | 72 } |
73 | 73 |
74 SendMessage("StatisticsUpdated", dict); | 74 SendMessage("StatisticsUpdated", dict); |
75 } | 75 } |
76 | 76 |
77 void QuotaInternalsHandler::SendMessage(const std::string& message, | 77 void QuotaInternalsHandler::SendMessage(const std::string& message, |
78 const base::Value& value) { | 78 const base::Value& value) { |
79 web_ui()->CallJavascriptFunctionUnsafe("cr.quota.messageHandler", | 79 web_ui()->CallJavascriptFunctionUnsafe("cr.quota.messageHandler", |
80 base::StringValue(message), value); | 80 base::Value(message), value); |
81 } | 81 } |
82 | 82 |
83 void QuotaInternalsHandler::OnRequestInfo(const base::ListValue*) { | 83 void QuotaInternalsHandler::OnRequestInfo(const base::ListValue*) { |
84 if (!proxy_.get()) | 84 if (!proxy_.get()) |
85 proxy_ = new QuotaInternalsProxy(this); | 85 proxy_ = new QuotaInternalsProxy(this); |
86 proxy_->RequestInfo( | 86 proxy_->RequestInfo( |
87 BrowserContext::GetDefaultStoragePartition( | 87 BrowserContext::GetDefaultStoragePartition( |
88 Profile::FromWebUI(web_ui()))->GetQuotaManager()); | 88 Profile::FromWebUI(web_ui()))->GetQuotaManager()); |
89 } | 89 } |
90 | 90 |
91 } // namespace quota_internals | 91 } // namespace quota_internals |
OLD | NEW |