| 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/linux/blimp_display_manager.h" | 5 #include "blimp/client/app/linux/blimp_display_manager.h" |
| 6 | 6 |
| 7 #include "blimp/client/feature/compositor/blimp_compositor_manager.h" | |
| 8 #include "blimp/client/feature/render_widget_feature.h" | 7 #include "blimp/client/feature/render_widget_feature.h" |
| 9 #include "blimp/client/feature/tab_control_feature.h" | 8 #include "blimp/client/feature/tab_control_feature.h" |
| 10 #include "ui/events/event.h" | 9 #include "ui/events/event.h" |
| 11 #include "ui/gfx/geometry/size.h" | 10 #include "ui/gfx/geometry/size.h" |
| 12 #include "ui/platform_window/platform_window.h" | 11 #include "ui/platform_window/platform_window.h" |
| 13 #include "ui/platform_window/x11/x11_window.h" | 12 #include "ui/platform_window/x11/x11_window.h" |
| 14 | 13 |
| 15 namespace blimp { | 14 namespace blimp { |
| 16 namespace client { | 15 namespace client { |
| 17 | 16 |
| 18 BlimpDisplayManager::BlimpDisplayManager( | 17 BlimpDisplayManager::BlimpDisplayManager( |
| 19 const gfx::Size& window_size, | 18 const gfx::Size& window_size, |
| 20 BlimpDisplayManagerDelegate* delegate, | 19 BlimpDisplayManagerDelegate* delegate, |
| 21 RenderWidgetFeature* render_widget_feature, | 20 RenderWidgetFeature* render_widget_feature, |
| 22 TabControlFeature* tab_control_feature) | 21 TabControlFeature* tab_control_feature) |
| 23 : device_pixel_ratio_(1.f), | 22 : device_pixel_ratio_(1.f), |
| 24 delegate_(delegate), | 23 delegate_(delegate), |
| 25 tab_control_feature_(tab_control_feature), | 24 tab_control_feature_(tab_control_feature), |
| 26 blimp_compositor_manager_( | 25 blimp_compositor_manager_( |
| 27 new BlimpCompositorManager(render_widget_feature)), | 26 new BlimpCompositorManager(render_widget_feature, this)), |
| 28 platform_window_(new ui::X11Window(this)) { | 27 platform_window_(new ui::X11Window(this)) { |
| 29 platform_window_->SetBounds(gfx::Rect(window_size)); | 28 platform_window_->SetBounds(gfx::Rect(window_size)); |
| 30 platform_window_->Show(); | 29 platform_window_->Show(); |
| 31 tab_control_feature_->SetSizeAndScale(platform_window_->GetBounds().size(), | 30 tab_control_feature_->SetSizeAndScale(platform_window_->GetBounds().size(), |
| 32 device_pixel_ratio_); | 31 device_pixel_ratio_); |
| 33 | 32 |
| 34 blimp_compositor_manager_->SetVisible(true); | 33 blimp_compositor_manager_->SetVisible(true); |
| 35 } | 34 } |
| 36 | 35 |
| 37 BlimpDisplayManager::~BlimpDisplayManager() {} | 36 BlimpDisplayManager::~BlimpDisplayManager() {} |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 if (widget != gfx::kNullAcceleratedWidget) | 71 if (widget != gfx::kNullAcceleratedWidget) |
| 73 blimp_compositor_manager_->SetAcceleratedWidget(widget); | 72 blimp_compositor_manager_->SetAcceleratedWidget(widget); |
| 74 } | 73 } |
| 75 | 74 |
| 76 void BlimpDisplayManager::OnAcceleratedWidgetDestroyed() { | 75 void BlimpDisplayManager::OnAcceleratedWidgetDestroyed() { |
| 77 blimp_compositor_manager_->ReleaseAcceleratedWidget(); | 76 blimp_compositor_manager_->ReleaseAcceleratedWidget(); |
| 78 } | 77 } |
| 79 | 78 |
| 80 void BlimpDisplayManager::OnActivationChanged(bool active) {} | 79 void BlimpDisplayManager::OnActivationChanged(bool active) {} |
| 81 | 80 |
| 81 void BlimpDisplayManager::OnSwapBuffersCompleted() {} |
| 82 |
| 82 } // namespace client | 83 } // namespace client |
| 83 } // namespace blimp | 84 } // namespace blimp |
| OLD | NEW |