| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 aura::client::SetActivationClient(window_tree_host_->window(), | 298 aura::client::SetActivationClient(window_tree_host_->window(), |
| 299 focus_client_.get()); | 299 focus_client_.get()); |
| 300 capture_client_.reset( | 300 capture_client_.reset( |
| 301 new aura::client::DefaultCaptureClient(window_tree_host_->window())); | 301 new aura::client::DefaultCaptureClient(window_tree_host_->window())); |
| 302 | 302 |
| 303 window_parenting_client_.reset( | 303 window_parenting_client_.reset( |
| 304 new BlimpWindowParentingClient(window_tree_host_->window())); | 304 new BlimpWindowParentingClient(window_tree_host_->window())); |
| 305 | 305 |
| 306 window_tree_host_->GetInputMethod()->AddObserver(this); | 306 window_tree_host_->GetInputMethod()->AddObserver(this); |
| 307 | 307 |
| 308 window_tree_host_->SetBounds(gfx::Rect(screen_->GetPrimaryDisplay().size())); | 308 window_tree_host_->SetBoundsInPixels( |
| 309 gfx::Rect(screen_->GetPrimaryDisplay().size())); |
| 309 | 310 |
| 310 RegisterFeatures(); | 311 RegisterFeatures(); |
| 311 | 312 |
| 312 // Initialize must only be posted after the RegisterFeature calls have | 313 // Initialize must only be posted after the RegisterFeature calls have |
| 313 // completed. | 314 // completed. |
| 314 content::BrowserThread::PostTask( | 315 content::BrowserThread::PostTask( |
| 315 content::BrowserThread::IO, FROM_HERE, | 316 content::BrowserThread::IO, FROM_HERE, |
| 316 base::Bind(&EngineNetworkComponents::Initialize, | 317 base::Bind(&EngineNetworkComponents::Initialize, |
| 317 base::Unretained(net_components_.get()), | 318 base::Unretained(net_components_.get()), |
| 318 base::ThreadTaskRunnerHandle::Get(), | 319 base::ThreadTaskRunnerHandle::Get(), |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 | 387 |
| 387 void BlimpEngineSession::CloseTab(const int target_tab_id) { | 388 void BlimpEngineSession::CloseTab(const int target_tab_id) { |
| 388 DVLOG(1) << "Close tab " << target_tab_id; | 389 DVLOG(1) << "Close tab " << target_tab_id; |
| 389 tab_.reset(); | 390 tab_.reset(); |
| 390 } | 391 } |
| 391 | 392 |
| 392 void BlimpEngineSession::HandleResize(float device_pixel_ratio, | 393 void BlimpEngineSession::HandleResize(float device_pixel_ratio, |
| 393 const gfx::Size& size) { | 394 const gfx::Size& size) { |
| 394 DVLOG(1) << "Resize to " << size.ToString() << ", " << device_pixel_ratio; | 395 DVLOG(1) << "Resize to " << size.ToString() << ", " << device_pixel_ratio; |
| 395 screen_->UpdateDisplayScaleAndSize(device_pixel_ratio, size); | 396 screen_->UpdateDisplayScaleAndSize(device_pixel_ratio, size); |
| 396 window_tree_host_->SetBounds(gfx::Rect(size)); | 397 window_tree_host_->SetBoundsInPixels(gfx::Rect(size)); |
| 397 if (tab_) { | 398 if (tab_) { |
| 398 tab_->Resize(device_pixel_ratio, | 399 tab_->Resize(device_pixel_ratio, |
| 399 screen_->GetPrimaryDisplay().bounds().size()); | 400 screen_->GetPrimaryDisplay().bounds().size()); |
| 400 } | 401 } |
| 401 } | 402 } |
| 402 | 403 |
| 403 void BlimpEngineSession::OnTextInputTypeChanged( | 404 void BlimpEngineSession::OnTextInputTypeChanged( |
| 404 const ui::TextInputClient* client) {} | 405 const ui::TextInputClient* client) {} |
| 405 | 406 |
| 406 void BlimpEngineSession::OnFocus() {} | 407 void BlimpEngineSession::OnFocus() {} |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 parent->AddChild(content); | 580 parent->AddChild(content); |
| 580 content->Show(); | 581 content->Show(); |
| 581 | 582 |
| 582 tab_ = base::MakeUnique<Tab>(std::move(new_contents), target_tab_id, | 583 tab_ = base::MakeUnique<Tab>(std::move(new_contents), target_tab_id, |
| 583 &render_widget_feature_, | 584 &render_widget_feature_, |
| 584 navigation_message_sender_.get()); | 585 navigation_message_sender_.get()); |
| 585 } | 586 } |
| 586 | 587 |
| 587 } // namespace engine | 588 } // namespace engine |
| 588 } // namespace blimp | 589 } // namespace blimp |
| OLD | NEW |