| 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 "components/bitmap_uploader/bitmap_uploader.h" | 8 #include "components/bitmap_uploader/bitmap_uploader.h" |
| 9 #include "components/mus/public/cpp/window.h" | 9 #include "components/mus/public/cpp/window.h" |
| 10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // example, in some unit test contexts. | 46 // example, in some unit test contexts. |
| 47 if (connector) { | 47 if (connector) { |
| 48 bitmap_uploader_.reset(new bitmap_uploader::BitmapUploader(window)); | 48 bitmap_uploader_.reset(new bitmap_uploader::BitmapUploader(window)); |
| 49 bitmap_uploader_->Init(connector); | 49 bitmap_uploader_->Init(connector); |
| 50 prop_.reset( | 50 prop_.reset( |
| 51 new ui::ViewProp(accelerated_widget, | 51 new ui::ViewProp(accelerated_widget, |
| 52 bitmap_uploader::kBitmapUploaderForAcceleratedWidget, | 52 bitmap_uploader::kBitmapUploaderForAcceleratedWidget, |
| 53 bitmap_uploader_.get())); | 53 bitmap_uploader_.get())); |
| 54 } | 54 } |
| 55 | 55 |
| 56 SetPlatformWindow(base::WrapUnique(new ui::StubWindow(nullptr))); | 56 SetPlatformWindow(base::WrapUnique(new ui::StubWindow( |
| 57 this, |
| 58 false))); // Do not advertise accelerated widget; already set manually. |
| 59 |
| 57 // Initialize the stub platform window bounds to those of the mus::Window. | 60 // Initialize the stub platform window bounds to those of the mus::Window. |
| 58 platform_window()->SetBounds(window->bounds()); | 61 platform_window()->SetBounds(window->bounds()); |
| 59 | 62 |
| 60 // The location of events is already transformed, and there is no way to | 63 // The location of events is already transformed, and there is no way to |
| 61 // correctly determine the reverse transform. So, don't attempt to transform | 64 // correctly determine the reverse transform. So, don't attempt to transform |
| 62 // event locations, else the root location is wrong. | 65 // event locations, else the root location is wrong. |
| 63 // TODO(sky): we need to transform for device scale though. | 66 // TODO(sky): we need to transform for device scale though. |
| 64 dispatcher()->set_transform_events(false); | 67 dispatcher()->set_transform_events(false); |
| 65 compositor()->SetHostHasTransparentBackground(true); | 68 compositor()->SetHostHasTransparentBackground(true); |
| 66 | 69 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 95 if (native_widget_) | 98 if (native_widget_) |
| 96 native_widget_->OnActivationChanged(active); | 99 native_widget_->OnActivationChanged(active); |
| 97 WindowTreeHostPlatform::OnActivationChanged(active); | 100 WindowTreeHostPlatform::OnActivationChanged(active); |
| 98 } | 101 } |
| 99 | 102 |
| 100 void WindowTreeHostMus::OnCloseRequest() { | 103 void WindowTreeHostMus::OnCloseRequest() { |
| 101 OnHostCloseRequested(); | 104 OnHostCloseRequested(); |
| 102 } | 105 } |
| 103 | 106 |
| 104 } // namespace views | 107 } // namespace views |
| OLD | NEW |