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