Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_config_client.cc |
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_client.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_client.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..77d122a99b8efc6595d092978117435b754e0c43 |
--- /dev/null |
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_client.cc |
@@ -0,0 +1,37 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_config_client.h" |
+ |
+#include "base/json/json_writer.h" |
+#include "base/logging.h" |
+#include "base/values.h" |
+#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.h" |
+#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h" |
+ |
+namespace data_reduction_proxy { |
+ |
+DataReductionProxyConfigClient::DataReductionProxyConfigClient( |
+ DataReductionProxyParams* params, |
+ DataReductionProxyRequestOptions* request_options) |
+ : params_(params), |
+ request_options_(request_options) { |
+ DCHECK(params); |
+ DCHECK(request_options); |
+} |
+ |
+DataReductionProxyConfigClient::~DataReductionProxyConfigClient() { |
+} |
+ |
+std::string DataReductionProxyConfigClient::ConstructStaticResponse() { |
bengr
2015/03/19 16:31:14
Can this method be const?
jeremyim
2015/03/20 16:21:10
Done.
|
+ std::string response; |
+ scoped_ptr<base::DictionaryValue> values(new base::DictionaryValue()); |
+ params_->PopulateConfigResponse(values.get()); |
+ request_options_->PopulateConfigResponse(values.get()); |
+ base::JSONWriter::Write(values.get(), &response); |
+ |
bengr
2015/03/19 16:31:14
Remove blank line.
jeremyim
2015/03/20 16:21:10
Done.
|
+ return response; |
+} |
+ |
+} // namespace data_reduction_proxy |