| 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/aura/mus/window_tree_host_mus.h" | 5 #include "ui/aura/mus/window_tree_host_mus.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "ui/aura/env.h" | 8 #include "ui/aura/env.h" |
| 9 #include "ui/aura/mus/input_method_mus.h" | 9 #include "ui/aura/mus/input_method_mus.h" |
| 10 #include "ui/aura/mus/window_port_mus.h" | 10 #include "ui/aura/mus/window_port_mus.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 return aura::Env::GetInstance()->context_factory()->DoesCreateTestContexts(); | 26 return aura::Env::GetInstance()->context_factory()->DoesCreateTestContexts(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 } // namespace | 29 } // namespace |
| 30 | 30 |
| 31 //////////////////////////////////////////////////////////////////////////////// | 31 //////////////////////////////////////////////////////////////////////////////// |
| 32 // WindowTreeHostMus, public: | 32 // WindowTreeHostMus, public: |
| 33 | 33 |
| 34 WindowTreeHostMus::WindowTreeHostMus( | 34 WindowTreeHostMus::WindowTreeHostMus( |
| 35 std::unique_ptr<WindowPortMus> window_port, | 35 std::unique_ptr<WindowPortMus> window_port, |
| 36 WindowTreeHostMusDelegate* delegate, | 36 WindowTreeClient* window_tree_client, |
| 37 int64_t display_id, | 37 int64_t display_id, |
| 38 const std::map<std::string, std::vector<uint8_t>>* properties) | 38 const std::map<std::string, std::vector<uint8_t>>* properties) |
| 39 : WindowTreeHostPlatform(std::move(window_port)), | 39 : WindowTreeHostPlatform(std::move(window_port)), |
| 40 display_id_(display_id), | 40 display_id_(display_id), |
| 41 delegate_(delegate) { | 41 delegate_(window_tree_client) { |
| 42 // TODO(sky): find a cleaner way to set this! Better solution is to likely | 42 // TODO(sky): find a cleaner way to set this! Better solution is to likely |
| 43 // have constructor take aura::Window. | 43 // have constructor take aura::Window. |
| 44 WindowPortMus::Get(window())->window_ = window(); | 44 WindowPortMus::Get(window())->window_ = window(); |
| 45 if (properties) { | 45 if (properties) { |
| 46 // Apply the properties before initializing the window, that way the | 46 // Apply the properties before initializing the window, that way the |
| 47 // server seems them at the time the window is created. | 47 // server seems them at the time the window is created. |
| 48 WindowMus* window_mus = WindowMus::Get(window()); | 48 WindowMus* window_mus = WindowMus::Get(window()); |
| 49 for (auto& pair : *properties) | 49 for (auto& pair : *properties) |
| 50 window_mus->SetPropertyFromServer(pair.first, &pair.second); | 50 window_mus->SetPropertyFromServer(pair.first, &pair.second); |
| 51 } | 51 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 68 // TODO(markdittmer): Use correct device-scale-factor from |window|. | 68 // TODO(markdittmer): Use correct device-scale-factor from |window|. |
| 69 OnAcceleratedWidgetAvailable(accelerated_widget, 1.f); | 69 OnAcceleratedWidgetAvailable(accelerated_widget, 1.f); |
| 70 | 70 |
| 71 delegate_->OnWindowTreeHostCreated(this); | 71 delegate_->OnWindowTreeHostCreated(this); |
| 72 | 72 |
| 73 SetPlatformWindow(base::MakeUnique<ui::StubWindow>( | 73 SetPlatformWindow(base::MakeUnique<ui::StubWindow>( |
| 74 this, | 74 this, |
| 75 false)); // Do not advertise accelerated widget; already set manually. | 75 false)); // Do not advertise accelerated widget; already set manually. |
| 76 | 76 |
| 77 input_method_ = base::MakeUnique<InputMethodMus>(this, window()); | 77 input_method_ = base::MakeUnique<InputMethodMus>(this, window()); |
| 78 input_method_->Init(window_tree_client->connector()); |
| 79 SetSharedInputMethod(input_method_.get()); |
| 78 | 80 |
| 79 compositor()->SetHostHasTransparentBackground(true); | 81 compositor()->SetHostHasTransparentBackground(true); |
| 80 | 82 |
| 81 // Mus windows are assumed hidden. | 83 // Mus windows are assumed hidden. |
| 82 compositor()->SetVisible(false); | 84 compositor()->SetVisible(false); |
| 83 } | 85 } |
| 84 | 86 |
| 85 WindowTreeHostMus::WindowTreeHostMus( | 87 WindowTreeHostMus::WindowTreeHostMus( |
| 86 WindowTreeClient* window_tree_client, | 88 WindowTreeClient* window_tree_client, |
| 87 const std::map<std::string, std::vector<uint8_t>>* properties) | 89 const std::map<std::string, std::vector<uint8_t>>* properties) |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 void WindowTreeHostMus::OnCloseRequest() { | 157 void WindowTreeHostMus::OnCloseRequest() { |
| 156 OnHostCloseRequested(); | 158 OnHostCloseRequested(); |
| 157 } | 159 } |
| 158 | 160 |
| 159 gfx::ICCProfile WindowTreeHostMus::GetICCProfileForCurrentDisplay() { | 161 gfx::ICCProfile WindowTreeHostMus::GetICCProfileForCurrentDisplay() { |
| 160 // TODO: This should read the profile from mus. crbug.com/647510 | 162 // TODO: This should read the profile from mus. crbug.com/647510 |
| 161 return gfx::ICCProfile(); | 163 return gfx::ICCProfile(); |
| 162 } | 164 } |
| 163 | 165 |
| 164 } // namespace aura | 166 } // namespace aura |
| OLD | NEW |