| 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 render_widget_feature_(&settings_feature_), |
| 183 net_components_( | 184 net_components_( |
| 184 new EngineNetworkComponents(net_log, | 185 new EngineNetworkComponents(net_log, |
| 185 QuitCurrentMessageLoopClosure())) { | 186 QuitCurrentMessageLoopClosure())) { |
| 186 DCHECK(engine_config_); | 187 DCHECK(engine_config_); |
| 187 screen_->UpdateDisplayScaleAndSize(kDefaultScaleFactor, | 188 screen_->UpdateDisplayScaleAndSize(kDefaultScaleFactor, |
| 188 gfx::Size(kDefaultDisplayWidth, | 189 gfx::Size(kDefaultDisplayWidth, |
| 189 kDefaultDisplayHeight)); | 190 kDefaultDisplayHeight)); |
| 190 render_widget_feature_.SetDelegate(kDummyTabId, this); | 191 render_widget_feature_.SetDelegate(kDummyTabId, this); |
| 191 } | 192 } |
| 192 | 193 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 thread_pipe_manager_->RegisterFeature(BlimpMessage::NAVIGATION, this); | 251 thread_pipe_manager_->RegisterFeature(BlimpMessage::NAVIGATION, this); |
| 251 render_widget_feature_.set_render_widget_message_sender( | 252 render_widget_feature_.set_render_widget_message_sender( |
| 252 thread_pipe_manager_->RegisterFeature(BlimpMessage::RENDER_WIDGET, | 253 thread_pipe_manager_->RegisterFeature(BlimpMessage::RENDER_WIDGET, |
| 253 &render_widget_feature_)); | 254 &render_widget_feature_)); |
| 254 render_widget_feature_.set_input_message_sender( | 255 render_widget_feature_.set_input_message_sender( |
| 255 thread_pipe_manager_->RegisterFeature(BlimpMessage::INPUT, | 256 thread_pipe_manager_->RegisterFeature(BlimpMessage::INPUT, |
| 256 &render_widget_feature_)); | 257 &render_widget_feature_)); |
| 257 render_widget_feature_.set_compositor_message_sender( | 258 render_widget_feature_.set_compositor_message_sender( |
| 258 thread_pipe_manager_->RegisterFeature(BlimpMessage::COMPOSITOR, | 259 thread_pipe_manager_->RegisterFeature(BlimpMessage::COMPOSITOR, |
| 259 &render_widget_feature_)); | 260 &render_widget_feature_)); |
| 261 settings_feature_.set_outgoing_message_processor( |
| 262 thread_pipe_manager_->RegisterFeature(BlimpMessage::SETTINGS, |
| 263 &settings_feature_)); |
| 260 } | 264 } |
| 261 | 265 |
| 262 bool BlimpEngineSession::CreateWebContents(const int target_tab_id) { | 266 bool BlimpEngineSession::CreateWebContents(const int target_tab_id) { |
| 263 DVLOG(1) << "Create tab " << target_tab_id; | 267 DVLOG(1) << "Create tab " << target_tab_id; |
| 264 // TODO(haibinlu): Support more than one active WebContents (crbug/547231). | 268 // TODO(haibinlu): Support more than one active WebContents (crbug/547231). |
| 265 if (web_contents_) { | 269 if (web_contents_) { |
| 266 DLOG(WARNING) << "Tab " << target_tab_id << " already existed"; | 270 DLOG(WARNING) << "Tab " << target_tab_id << " already existed"; |
| 267 return false; | 271 return false; |
| 268 } | 272 } |
| 269 | 273 |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 | 514 |
| 511 aura::Window* parent = window_tree_host_->window(); | 515 aura::Window* parent = window_tree_host_->window(); |
| 512 aura::Window* content = web_contents_->GetNativeView(); | 516 aura::Window* content = web_contents_->GetNativeView(); |
| 513 if (!parent->Contains(content)) | 517 if (!parent->Contains(content)) |
| 514 parent->AddChild(content); | 518 parent->AddChild(content); |
| 515 content->Show(); | 519 content->Show(); |
| 516 } | 520 } |
| 517 | 521 |
| 518 } // namespace engine | 522 } // namespace engine |
| 519 } // namespace blimp | 523 } // namespace blimp |
| OLD | NEW |