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/window.h" | 9 #include "ui/aura/window.h" |
10 #include "ui/aura/window_event_dispatcher.h" | 10 #include "ui/aura/window_event_dispatcher.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // Initialize the stub platform window bounds to those of the ui::Window. | 47 // Initialize the stub platform window bounds to those of the ui::Window. |
48 platform_window()->SetBounds(window->bounds()); | 48 platform_window()->SetBounds(window->bounds()); |
49 | 49 |
50 // The location of events is already transformed, and there is no way to | 50 // The location of events is already transformed, and there is no way to |
51 // correctly determine the reverse transform. So, don't attempt to transform | 51 // correctly determine the reverse transform. So, don't attempt to transform |
52 // event locations, else the root location is wrong. | 52 // event locations, else the root location is wrong. |
53 // TODO(sky): we need to transform for device scale though. | 53 // TODO(sky): we need to transform for device scale though. |
54 dispatcher()->set_transform_events(false); | 54 dispatcher()->set_transform_events(false); |
55 compositor()->SetHostHasTransparentBackground(true); | 55 compositor()->SetHostHasTransparentBackground(true); |
56 | 56 |
57 input_method_.reset(new InputMethodMus(this, window)); | 57 input_method_ = base::MakeUnique<InputMethodMus>(this, window); |
58 SetSharedInputMethod(input_method_.get()); | 58 SetSharedInputMethod(input_method_.get()); |
59 } | 59 } |
60 | 60 |
61 WindowTreeHostMus::~WindowTreeHostMus() { | 61 WindowTreeHostMus::~WindowTreeHostMus() { |
62 DestroyCompositor(); | 62 DestroyCompositor(); |
63 DestroyDispatcher(); | 63 DestroyDispatcher(); |
64 } | 64 } |
65 | 65 |
66 void WindowTreeHostMus::InitInputMethod(shell::Connector* connector) { | 66 void WindowTreeHostMus::InitInputMethod(shell::Connector* connector) { |
67 input_method_->Init(connector); | 67 input_method_->Init(connector); |
(...skipping 25 matching lines...) Expand all Loading... |
93 void WindowTreeHostMus::OnCloseRequest() { | 93 void WindowTreeHostMus::OnCloseRequest() { |
94 OnHostCloseRequested(); | 94 OnHostCloseRequested(); |
95 } | 95 } |
96 | 96 |
97 gfx::ICCProfile WindowTreeHostMus::GetICCProfileForCurrentDisplay() { | 97 gfx::ICCProfile WindowTreeHostMus::GetICCProfileForCurrentDisplay() { |
98 // TODO: This should read the profile from mus. crbug.com/647510 | 98 // TODO: This should read the profile from mus. crbug.com/647510 |
99 return gfx::ICCProfile(); | 99 return gfx::ICCProfile(); |
100 } | 100 } |
101 | 101 |
102 } // namespace views | 102 } // namespace views |
OLD | NEW |