| OLD | NEW |
| 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/app/session/blimp_client_session.h" | 5 #include "blimp/client/app/session/blimp_client_session.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 BlimpClientSession::BlimpClientSession(const GURL& assigner_endpoint) | 49 BlimpClientSession::BlimpClientSession(const GURL& assigner_endpoint) |
| 50 : io_thread_("BlimpIOThread"), | 50 : io_thread_("BlimpIOThread"), |
| 51 geolocation_feature_(base::MakeUnique<GeolocationFeature>( | 51 geolocation_feature_(base::MakeUnique<GeolocationFeature>( |
| 52 base::MakeUnique<device::LocationArbitrator>( | 52 base::MakeUnique<device::LocationArbitrator>( |
| 53 base::MakeUnique<device::GeolocationDelegate>()))), | 53 base::MakeUnique<device::GeolocationDelegate>()))), |
| 54 tab_control_feature_(new TabControlFeature), | 54 tab_control_feature_(new TabControlFeature), |
| 55 navigation_feature_(new NavigationFeature), | 55 navigation_feature_(new NavigationFeature), |
| 56 ime_feature_(new ImeFeature), | 56 ime_feature_(new ImeFeature), |
| 57 render_widget_feature_(new RenderWidgetFeature), | 57 render_widget_feature_(new RenderWidgetFeature), |
| 58 settings_feature_(new SettingsFeature), | 58 settings_feature_(new SettingsFeature(nullptr)), |
| 59 weak_factory_(this) { | 59 weak_factory_(this) { |
| 60 base::Thread::Options options; | 60 base::Thread::Options options; |
| 61 options.message_loop_type = base::MessageLoop::TYPE_IO; | 61 options.message_loop_type = base::MessageLoop::TYPE_IO; |
| 62 io_thread_.StartWithOptions(options); | 62 io_thread_.StartWithOptions(options); |
| 63 net_components_.reset(new ClientNetworkComponents( | 63 net_components_.reset(new ClientNetworkComponents( |
| 64 base::MakeUnique<CrossThreadNetworkEventObserver>( | 64 base::MakeUnique<CrossThreadNetworkEventObserver>( |
| 65 weak_factory_.GetWeakPtr(), base::SequencedTaskRunnerHandle::Get()))); | 65 weak_factory_.GetWeakPtr(), base::SequencedTaskRunnerHandle::Get()))); |
| 66 | 66 |
| 67 assignment_source_.reset(new AssignmentSource( | 67 assignment_source_.reset(new AssignmentSource( |
| 68 assigner_endpoint, io_thread_.task_runner(), io_thread_.task_runner())); | 68 assigner_endpoint, io_thread_.task_runner(), io_thread_.task_runner())); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 blob_delegate_); | 144 blob_delegate_); |
| 145 | 145 |
| 146 // Client will not send send any RenderWidget messages, so don't save the | 146 // Client will not send send any RenderWidget messages, so don't save the |
| 147 // outgoing BlimpMessageProcessor in the RenderWidgetFeature. | 147 // outgoing BlimpMessageProcessor in the RenderWidgetFeature. |
| 148 thread_pipe_manager_->RegisterFeature(BlimpMessage::kRenderWidget, | 148 thread_pipe_manager_->RegisterFeature(BlimpMessage::kRenderWidget, |
| 149 render_widget_feature_.get()); | 149 render_widget_feature_.get()); |
| 150 | 150 |
| 151 ime_feature_->set_outgoing_message_processor( | 151 ime_feature_->set_outgoing_message_processor( |
| 152 thread_pipe_manager_->RegisterFeature(BlimpMessage::kIme, | 152 thread_pipe_manager_->RegisterFeature(BlimpMessage::kIme, |
| 153 ime_feature_.get())); | 153 ime_feature_.get())); |
| 154 | |
| 155 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 156 switches::kDownloadWholeDocument)) | |
| 157 settings_feature_->SetRecordWholeDocument(true); | |
| 158 } | 154 } |
| 159 | 155 |
| 160 void BlimpClientSession::DropConnection() { | 156 void BlimpClientSession::DropConnection() { |
| 161 io_thread_.task_runner()->PostTask( | 157 io_thread_.task_runner()->PostTask( |
| 162 FROM_HERE, base::Bind(&DropConnectionOnIOThread, net_components_.get())); | 158 FROM_HERE, base::Bind(&DropConnectionOnIOThread, net_components_.get())); |
| 163 } | 159 } |
| 164 | 160 |
| 165 void BlimpClientSession::OnConnected() {} | 161 void BlimpClientSession::OnConnected() {} |
| 166 | 162 |
| 167 void BlimpClientSession::OnDisconnected(int result) {} | 163 void BlimpClientSession::OnDisconnected(int result) {} |
| (...skipping 17 matching lines...) Expand all Loading... |
| 185 RenderWidgetFeature* BlimpClientSession::GetRenderWidgetFeature() const { | 181 RenderWidgetFeature* BlimpClientSession::GetRenderWidgetFeature() const { |
| 186 return render_widget_feature_.get(); | 182 return render_widget_feature_.get(); |
| 187 } | 183 } |
| 188 | 184 |
| 189 SettingsFeature* BlimpClientSession::GetSettingsFeature() const { | 185 SettingsFeature* BlimpClientSession::GetSettingsFeature() const { |
| 190 return settings_feature_.get(); | 186 return settings_feature_.get(); |
| 191 } | 187 } |
| 192 | 188 |
| 193 } // namespace client | 189 } // namespace client |
| 194 } // namespace blimp | 190 } // namespace blimp |
| OLD | NEW |