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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
haibinlu 2016/03/21 18:25:22 2016
Khushal 2016/03/22 04:11:42 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "blimp/client/feature/settings_feature.h"
6
7 #include "blimp/common/create_blimp_message.h"
8 #include "blimp/common/proto/blimp_message.pb.h"
9 #include "blimp/common/proto/settings.pb.h"
10 #include "net/base/net_errors.h"
11
12 namespace blimp {
13 namespace client {
14
15 SettingsFeature::SettingsFeature()
16 : record_whole_document_(false) {}
17
18 SettingsFeature::~SettingsFeature() {}
19
20 void SettingsFeature::set_outgoing_message_processor(
21 scoped_ptr<BlimpMessageProcessor> processor) {
22 outgoing_message_processor_ = std::move(processor);
23 }
24
25 void SettingsFeature::SetRecordWholeDocument(bool record_whole_document) {
26 if (record_whole_document_ == record_whole_document)
27 return;
28
29 record_whole_document_ = record_whole_document;
30
31 EngineSettingsMessage* engine_settings;
32 scoped_ptr<BlimpMessage> message = CreateBlimpMessage(&engine_settings);
33 engine_settings->set_record_whole_document(record_whole_document_);
34 outgoing_message_processor_->ProcessMessage(std::move(message),
35 net::CompletionCallback());
36 }
37
38 void SettingsFeature::ProcessMessage(
39 scoped_ptr<BlimpMessage> message,
40 const net::CompletionCallback& callback) {
41 // We don't receive any messages from the engine yet.
42 callback.Run(net::OK);
haibinlu 2016/03/21 18:25:22 NOTREACHED() << "<error message here>";
Khushal 2016/03/22 04:11:42 Done.
43 }
44
45 } // namespace client
46 } // namespace blimp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698