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

Unified Diff: blimp/client/feature/settings_feature.cc

Issue 1810213009: blimp: Add settings to allow the client to download the whole page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@record_full_document
Patch Set: Use ContentBrowserClient to override prefs. Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « blimp/client/feature/settings_feature.h ('k') | blimp/client/session/blimp_client_session.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5c3e31ed1b164bb67d3db1dc500beade25d13eb5
--- /dev/null
+++ b/blimp/client/feature/settings_feature.cc
@@ -0,0 +1,45 @@
+// Copyright 2016 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 "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.
+ NOTREACHED() << "Invalid settings message received from the engine.";
+ callback.Run(net::OK);
+}
+
+} // namespace client
+} // namespace blimp
« no previous file with comments | « blimp/client/feature/settings_feature.h ('k') | blimp/client/session/blimp_client_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698