| 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 20 matching lines...) Expand all Loading... |
| 31 base::Bind(&QuotaInternalsHandler::OnRequestInfo, | 31 base::Bind(&QuotaInternalsHandler::OnRequestInfo, |
| 32 base::Unretained(this))); | 32 base::Unretained(this))); |
| 33 } | 33 } |
| 34 | 34 |
| 35 void QuotaInternalsHandler::ReportAvailableSpace(int64_t available_space) { | 35 void QuotaInternalsHandler::ReportAvailableSpace(int64_t available_space) { |
| 36 SendMessage("AvailableSpaceUpdated", | 36 SendMessage("AvailableSpaceUpdated", |
| 37 base::FundamentalValue(static_cast<double>(available_space))); | 37 base::FundamentalValue(static_cast<double>(available_space))); |
| 38 } | 38 } |
| 39 | 39 |
| 40 void QuotaInternalsHandler::ReportGlobalInfo(const GlobalStorageInfo& data) { | 40 void QuotaInternalsHandler::ReportGlobalInfo(const GlobalStorageInfo& data) { |
| 41 scoped_ptr<base::Value> value(data.NewValue()); | 41 std::unique_ptr<base::Value> value(data.NewValue()); |
| 42 SendMessage("GlobalInfoUpdated", *value); | 42 SendMessage("GlobalInfoUpdated", *value); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void QuotaInternalsHandler::ReportPerHostInfo( | 45 void QuotaInternalsHandler::ReportPerHostInfo( |
| 46 const std::vector<PerHostStorageInfo>& hosts) { | 46 const std::vector<PerHostStorageInfo>& hosts) { |
| 47 base::ListValue values; | 47 base::ListValue values; |
| 48 typedef std::vector<PerHostStorageInfo>::const_iterator iterator; | 48 typedef std::vector<PerHostStorageInfo>::const_iterator iterator; |
| 49 for (iterator itr(hosts.begin()); itr != hosts.end(); ++itr) { | 49 for (iterator itr(hosts.begin()); itr != hosts.end(); ++itr) { |
| 50 values.Append(itr->NewValue()); | 50 values.Append(itr->NewValue()); |
| 51 } | 51 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 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 |