| 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/engine/session/blimp_engine_session.h" | 5 #include "blimp/engine/session/blimp_engine_session.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 return connection_handler_.get(); | 173 return connection_handler_.get(); |
| 174 } | 174 } |
| 175 | 175 |
| 176 BlimpEngineSession::BlimpEngineSession( | 176 BlimpEngineSession::BlimpEngineSession( |
| 177 scoped_ptr<BlimpBrowserContext> browser_context, | 177 scoped_ptr<BlimpBrowserContext> browser_context, |
| 178 net::NetLog* net_log, | 178 net::NetLog* net_log, |
| 179 BlimpEngineConfig* engine_config) | 179 BlimpEngineConfig* engine_config) |
| 180 : browser_context_(std::move(browser_context)), | 180 : browser_context_(std::move(browser_context)), |
| 181 engine_config_(engine_config), | 181 engine_config_(engine_config), |
| 182 screen_(new BlimpScreen), | 182 screen_(new BlimpScreen), |
| 183 settings_feature_(&settings_manager_), |
| 184 render_widget_feature_(&settings_manager_), |
| 183 net_components_( | 185 net_components_( |
| 184 new EngineNetworkComponents(net_log, | 186 new EngineNetworkComponents(net_log, |
| 185 QuitCurrentMessageLoopClosure())) { | 187 QuitCurrentMessageLoopClosure())) { |
| 186 DCHECK(engine_config_); | 188 DCHECK(engine_config_); |
| 187 screen_->UpdateDisplayScaleAndSize(kDefaultScaleFactor, | 189 screen_->UpdateDisplayScaleAndSize(kDefaultScaleFactor, |
| 188 gfx::Size(kDefaultDisplayWidth, | 190 gfx::Size(kDefaultDisplayWidth, |
| 189 kDefaultDisplayHeight)); | 191 kDefaultDisplayHeight)); |
| 190 render_widget_feature_.SetDelegate(kDummyTabId, this); | 192 render_widget_feature_.SetDelegate(kDummyTabId, this); |
| 191 } | 193 } |
| 192 | 194 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 thread_pipe_manager_->RegisterFeature(BlimpMessage::NAVIGATION, this); | 252 thread_pipe_manager_->RegisterFeature(BlimpMessage::NAVIGATION, this); |
| 251 render_widget_feature_.set_render_widget_message_sender( | 253 render_widget_feature_.set_render_widget_message_sender( |
| 252 thread_pipe_manager_->RegisterFeature(BlimpMessage::RENDER_WIDGET, | 254 thread_pipe_manager_->RegisterFeature(BlimpMessage::RENDER_WIDGET, |
| 253 &render_widget_feature_)); | 255 &render_widget_feature_)); |
| 254 render_widget_feature_.set_input_message_sender( | 256 render_widget_feature_.set_input_message_sender( |
| 255 thread_pipe_manager_->RegisterFeature(BlimpMessage::INPUT, | 257 thread_pipe_manager_->RegisterFeature(BlimpMessage::INPUT, |
| 256 &render_widget_feature_)); | 258 &render_widget_feature_)); |
| 257 render_widget_feature_.set_compositor_message_sender( | 259 render_widget_feature_.set_compositor_message_sender( |
| 258 thread_pipe_manager_->RegisterFeature(BlimpMessage::COMPOSITOR, | 260 thread_pipe_manager_->RegisterFeature(BlimpMessage::COMPOSITOR, |
| 259 &render_widget_feature_)); | 261 &render_widget_feature_)); |
| 262 |
| 263 // The Settings feature does not need an outgoing message processor, since we |
| 264 // don't send any messages to the client right now. |
| 265 thread_pipe_manager_->RegisterFeature(BlimpMessage::SETTINGS, |
| 266 &settings_feature_); |
| 260 } | 267 } |
| 261 | 268 |
| 262 bool BlimpEngineSession::CreateWebContents(const int target_tab_id) { | 269 bool BlimpEngineSession::CreateWebContents(const int target_tab_id) { |
| 263 DVLOG(1) << "Create tab " << target_tab_id; | 270 DVLOG(1) << "Create tab " << target_tab_id; |
| 264 // TODO(haibinlu): Support more than one active WebContents (crbug/547231). | 271 // TODO(haibinlu): Support more than one active WebContents (crbug/547231). |
| 265 if (web_contents_) { | 272 if (web_contents_) { |
| 266 DLOG(WARNING) << "Tab " << target_tab_id << " already existed"; | 273 DLOG(WARNING) << "Tab " << target_tab_id << " already existed"; |
| 267 return false; | 274 return false; |
| 268 } | 275 } |
| 269 | 276 |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 | 517 |
| 511 aura::Window* parent = window_tree_host_->window(); | 518 aura::Window* parent = window_tree_host_->window(); |
| 512 aura::Window* content = web_contents_->GetNativeView(); | 519 aura::Window* content = web_contents_->GetNativeView(); |
| 513 if (!parent->Contains(content)) | 520 if (!parent->Contains(content)) |
| 514 parent->AddChild(content); | 521 parent->AddChild(content); |
| 515 content->Show(); | 522 content->Show(); |
| 516 } | 523 } |
| 517 | 524 |
| 518 } // namespace engine | 525 } // namespace engine |
| 519 } // namespace blimp | 526 } // namespace blimp |
| OLD | NEW |