Chromium Code Reviews| Index: blimp/client/feature/settings_feature.cc |
| diff --git a/blimp/client/feature/settings_feature.cc b/blimp/client/feature/settings_feature.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..eb2f2f43dc4c1ff45dd2c00a1631663f48f23bfe |
| --- /dev/null |
| +++ b/blimp/client/feature/settings_feature.cc |
| @@ -0,0 +1,46 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
|
haibinlu
2016/03/21 18:25:22
2016
Khushal
2016/03/22 04:11:42
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "blimp/client/feature/settings_feature.h" |
| + |
| +#include "blimp/common/create_blimp_message.h" |
| +#include "blimp/common/proto/blimp_message.pb.h" |
| +#include "blimp/common/proto/settings.pb.h" |
| +#include "net/base/net_errors.h" |
| + |
| +namespace blimp { |
| +namespace client { |
| + |
| +SettingsFeature::SettingsFeature() |
| + : record_whole_document_(false) {} |
| + |
| +SettingsFeature::~SettingsFeature() {} |
| + |
| +void SettingsFeature::set_outgoing_message_processor( |
| + scoped_ptr<BlimpMessageProcessor> processor) { |
| + outgoing_message_processor_ = std::move(processor); |
| +} |
| + |
| +void SettingsFeature::SetRecordWholeDocument(bool record_whole_document) { |
| + if (record_whole_document_ == record_whole_document) |
| + return; |
| + |
| + record_whole_document_ = record_whole_document; |
| + |
| + EngineSettingsMessage* engine_settings; |
| + scoped_ptr<BlimpMessage> message = CreateBlimpMessage(&engine_settings); |
| + engine_settings->set_record_whole_document(record_whole_document_); |
| + outgoing_message_processor_->ProcessMessage(std::move(message), |
| + net::CompletionCallback()); |
| +} |
| + |
| +void SettingsFeature::ProcessMessage( |
| + scoped_ptr<BlimpMessage> message, |
| + const net::CompletionCallback& callback) { |
| + // We don't receive any messages from the engine yet. |
| + callback.Run(net::OK); |
|
haibinlu
2016/03/21 18:25:22
NOTREACHED() << "<error message here>";
Khushal
2016/03/22 04:11:42
Done.
|
| +} |
| + |
| +} // namespace client |
| +} // namespace blimp |