| 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 "ui/views/mus/window_tree_host_mus.h" | 5 #include "ui/views/mus/window_tree_host_mus.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "services/ui/public/cpp/window.h" | 8 #include "services/ui/public/cpp/window.h" |
| 9 #include "ui/aura/env.h" | 9 #include "ui/aura/env.h" |
| 10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| 11 #include "ui/aura/window_event_dispatcher.h" | 11 #include "ui/aura/window_event_dispatcher.h" |
| 12 #include "ui/events/event.h" | 12 #include "ui/events/event.h" |
| 13 #include "ui/gfx/geometry/dip_util.h" |
| 13 #include "ui/platform_window/stub/stub_window.h" | 14 #include "ui/platform_window/stub/stub_window.h" |
| 14 #include "ui/views/mus/input_method_mus.h" | 15 #include "ui/views/mus/input_method_mus.h" |
| 15 #include "ui/views/mus/native_widget_mus.h" | 16 #include "ui/views/mus/native_widget_mus.h" |
| 16 | 17 |
| 17 namespace views { | 18 namespace views { |
| 18 | 19 |
| 19 namespace { | 20 namespace { |
| 20 static uint32_t accelerated_widget_count = 1; | 21 static uint32_t accelerated_widget_count = 1; |
| 21 | 22 |
| 22 bool IsUsingTestContext() { | 23 bool IsUsingTestContext() { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 49 // TODO(markdittmer): Use correct device-scale-factor from |window|. | 50 // TODO(markdittmer): Use correct device-scale-factor from |window|. |
| 50 OnAcceleratedWidgetAvailable(accelerated_widget, 1.f); | 51 OnAcceleratedWidgetAvailable(accelerated_widget, 1.f); |
| 51 | 52 |
| 52 SetPlatformWindow(base::MakeUnique<ui::StubWindow>( | 53 SetPlatformWindow(base::MakeUnique<ui::StubWindow>( |
| 53 this, | 54 this, |
| 54 false)); // Do not advertise accelerated widget; already set manually. | 55 false)); // Do not advertise accelerated widget; already set manually. |
| 55 | 56 |
| 56 compositor()->SetWindow(window); | 57 compositor()->SetWindow(window); |
| 57 | 58 |
| 58 // Initialize the stub platform window bounds to those of the ui::Window. | 59 // Initialize the stub platform window bounds to those of the ui::Window. |
| 59 platform_window()->SetBounds(window->bounds()); | 60 platform_window()->SetBounds(gfx::ConvertRectToPixel( |
| 61 compositor()->device_scale_factor(), window->bounds())); |
| 60 | 62 |
| 61 compositor()->SetHostHasTransparentBackground(true); | 63 compositor()->SetHostHasTransparentBackground(true); |
| 62 } | 64 } |
| 63 | 65 |
| 64 WindowTreeHostMus::~WindowTreeHostMus() { | 66 WindowTreeHostMus::~WindowTreeHostMus() { |
| 65 DestroyCompositor(); | 67 DestroyCompositor(); |
| 66 DestroyDispatcher(); | 68 DestroyDispatcher(); |
| 67 } | 69 } |
| 68 | 70 |
| 69 void WindowTreeHostMus::DispatchEvent(ui::Event* event) { | 71 void WindowTreeHostMus::DispatchEvent(ui::Event* event) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 90 void WindowTreeHostMus::OnCloseRequest() { | 92 void WindowTreeHostMus::OnCloseRequest() { |
| 91 OnHostCloseRequested(); | 93 OnHostCloseRequested(); |
| 92 } | 94 } |
| 93 | 95 |
| 94 gfx::ICCProfile WindowTreeHostMus::GetICCProfileForCurrentDisplay() { | 96 gfx::ICCProfile WindowTreeHostMus::GetICCProfileForCurrentDisplay() { |
| 95 // TODO: This should read the profile from mus. crbug.com/647510 | 97 // TODO: This should read the profile from mus. crbug.com/647510 |
| 96 return gfx::ICCProfile(); | 98 return gfx::ICCProfile(); |
| 97 } | 99 } |
| 98 | 100 |
| 99 } // namespace views | 101 } // namespace views |
| OLD | NEW |