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

Side by Side Diff: blimp/client/session/blimp_client_session.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 unified diff | Download patch
« no previous file with comments | « blimp/client/session/blimp_client_session.h ('k') | blimp/common/create_blimp_message.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "blimp/client/session/blimp_client_session.h" 5 #include "blimp/client/session/blimp_client_session.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/numerics/safe_conversions.h" 10 #include "base/numerics/safe_conversions.h"
11 #include "base/strings/string_number_conversions.h" 11 #include "base/strings/string_number_conversions.h"
12 #include "base/thread_task_runner_handle.h" 12 #include "base/thread_task_runner_handle.h"
13 #include "base/threading/sequenced_task_runner_handle.h" 13 #include "base/threading/sequenced_task_runner_handle.h"
14 #include "blimp/client/app/blimp_client_switches.h" 14 #include "blimp/client/app/blimp_client_switches.h"
15 #include "blimp/client/feature/ime_feature.h" 15 #include "blimp/client/feature/ime_feature.h"
16 #include "blimp/client/feature/navigation_feature.h" 16 #include "blimp/client/feature/navigation_feature.h"
17 #include "blimp/client/feature/render_widget_feature.h" 17 #include "blimp/client/feature/render_widget_feature.h"
18 #include "blimp/client/feature/settings_feature.h"
18 #include "blimp/client/feature/tab_control_feature.h" 19 #include "blimp/client/feature/tab_control_feature.h"
19 #include "blimp/net/blimp_connection.h" 20 #include "blimp/net/blimp_connection.h"
20 #include "blimp/net/blimp_message_processor.h" 21 #include "blimp/net/blimp_message_processor.h"
21 #include "blimp/net/blimp_message_thread_pipe.h" 22 #include "blimp/net/blimp_message_thread_pipe.h"
22 #include "blimp/net/browser_connection_handler.h" 23 #include "blimp/net/browser_connection_handler.h"
23 #include "blimp/net/client_connection_manager.h" 24 #include "blimp/net/client_connection_manager.h"
24 #include "blimp/net/common.h" 25 #include "blimp/net/common.h"
25 #include "blimp/net/connection_handler.h" 26 #include "blimp/net/connection_handler.h"
26 #include "blimp/net/null_blimp_message_processor.h" 27 #include "blimp/net/null_blimp_message_processor.h"
27 #include "blimp/net/ssl_client_transport.h" 28 #include "blimp/net/ssl_client_transport.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 void ClientNetworkComponents::OnConnectionError(int result) { 146 void ClientNetworkComponents::OnConnectionError(int result) {
146 network_observer_->OnDisconnected(result); 147 network_observer_->OnDisconnected(result);
147 } 148 }
148 149
149 BlimpClientSession::BlimpClientSession() 150 BlimpClientSession::BlimpClientSession()
150 : io_thread_("BlimpIOThread"), 151 : io_thread_("BlimpIOThread"),
151 tab_control_feature_(new TabControlFeature), 152 tab_control_feature_(new TabControlFeature),
152 navigation_feature_(new NavigationFeature), 153 navigation_feature_(new NavigationFeature),
153 ime_feature_(new ImeFeature), 154 ime_feature_(new ImeFeature),
154 render_widget_feature_(new RenderWidgetFeature), 155 render_widget_feature_(new RenderWidgetFeature),
156 settings_feature_(new SettingsFeature),
155 weak_factory_(this) { 157 weak_factory_(this) {
156 net_components_.reset(new ClientNetworkComponents( 158 net_components_.reset(new ClientNetworkComponents(
157 make_scoped_ptr(new CrossThreadNetworkEventObserver( 159 make_scoped_ptr(new CrossThreadNetworkEventObserver(
158 weak_factory_.GetWeakPtr(), 160 weak_factory_.GetWeakPtr(),
159 base::SequencedTaskRunnerHandle::Get())))); 161 base::SequencedTaskRunnerHandle::Get()))));
160 base::Thread::Options options; 162 base::Thread::Options options;
161 options.message_loop_type = base::MessageLoop::TYPE_IO; 163 options.message_loop_type = base::MessageLoop::TYPE_IO;
162 io_thread_.StartWithOptions(options); 164 io_thread_.StartWithOptions(options);
163 165
164 assignment_source_.reset( 166 assignment_source_.reset(
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 tab_control_feature_.get())); 214 tab_control_feature_.get()));
213 navigation_feature_->set_outgoing_message_processor( 215 navigation_feature_->set_outgoing_message_processor(
214 thread_pipe_manager_->RegisterFeature(BlimpMessage::NAVIGATION, 216 thread_pipe_manager_->RegisterFeature(BlimpMessage::NAVIGATION,
215 navigation_feature_.get())); 217 navigation_feature_.get()));
216 render_widget_feature_->set_outgoing_input_message_processor( 218 render_widget_feature_->set_outgoing_input_message_processor(
217 thread_pipe_manager_->RegisterFeature(BlimpMessage::INPUT, 219 thread_pipe_manager_->RegisterFeature(BlimpMessage::INPUT,
218 render_widget_feature_.get())); 220 render_widget_feature_.get()));
219 render_widget_feature_->set_outgoing_compositor_message_processor( 221 render_widget_feature_->set_outgoing_compositor_message_processor(
220 thread_pipe_manager_->RegisterFeature(BlimpMessage::COMPOSITOR, 222 thread_pipe_manager_->RegisterFeature(BlimpMessage::COMPOSITOR,
221 render_widget_feature_.get())); 223 render_widget_feature_.get()));
224 settings_feature_->set_outgoing_message_processor(
225 thread_pipe_manager_->RegisterFeature(BlimpMessage::SETTINGS,
226 settings_feature_.get()));
227
228 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
229 switches::kDownloadWholeDocument))
230 settings_feature_->SetRecordWholeDocument(true);
222 231
223 // Client will not send send any RenderWidget messages, so don't save the 232 // Client will not send send any RenderWidget messages, so don't save the
224 // outgoing BlimpMessageProcessor in the RenderWidgetFeature. 233 // outgoing BlimpMessageProcessor in the RenderWidgetFeature.
225 thread_pipe_manager_->RegisterFeature(BlimpMessage::RENDER_WIDGET, 234 thread_pipe_manager_->RegisterFeature(BlimpMessage::RENDER_WIDGET,
226 render_widget_feature_.get()); 235 render_widget_feature_.get());
227 236
228 ime_feature_->set_outgoing_message_processor( 237 ime_feature_->set_outgoing_message_processor(
229 thread_pipe_manager_->RegisterFeature(BlimpMessage::IME, 238 thread_pipe_manager_->RegisterFeature(BlimpMessage::IME,
230 ime_feature_.get())); 239 ime_feature_.get()));
231 } 240 }
(...skipping 13 matching lines...) Expand all
245 ImeFeature* BlimpClientSession::GetImeFeature() const { 254 ImeFeature* BlimpClientSession::GetImeFeature() const {
246 return ime_feature_.get(); 255 return ime_feature_.get();
247 } 256 }
248 257
249 RenderWidgetFeature* BlimpClientSession::GetRenderWidgetFeature() const { 258 RenderWidgetFeature* BlimpClientSession::GetRenderWidgetFeature() const {
250 return render_widget_feature_.get(); 259 return render_widget_feature_.get();
251 } 260 }
252 261
253 } // namespace client 262 } // namespace client
254 } // namespace blimp 263 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/client/session/blimp_client_session.h ('k') | blimp/common/create_blimp_message.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698