OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ash/mus/sysui/sysui_application.h" | 5 #include "ash/mus/sysui/sysui_application.h" |
6 | 6 |
7 #include "ash/desktop_background/desktop_background_controller.h" | 7 #include "ash/desktop_background/desktop_background_controller.h" |
8 #include "ash/host/ash_window_tree_host_init_params.h" | 8 #include "ash/host/ash_window_tree_host_init_params.h" |
9 #include "ash/host/ash_window_tree_host_platform.h" | 9 #include "ash/host/ash_window_tree_host_platform.h" |
10 #include "ash/mus/sysui/shell_delegate_mus.h" | 10 #include "ash/mus/sysui/shell_delegate_mus.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
92 views::internal::NativeWidgetDelegate* delegate) { | 92 views::internal::NativeWidgetDelegate* delegate) { |
93 std::map<std::string, std::vector<uint8_t>> properties; | 93 std::map<std::string, std::vector<uint8_t>> properties; |
94 if (params.parent) { | 94 if (params.parent) { |
95 mash::wm::mojom::Container container = GetContainerId(params.parent); | 95 mash::wm::mojom::Container container = GetContainerId(params.parent); |
96 if (container != mash::wm::mojom::Container::COUNT) { | 96 if (container != mash::wm::mojom::Container::COUNT) { |
97 properties[mash::wm::mojom::kWindowContainer_Property] = | 97 properties[mash::wm::mojom::kWindowContainer_Property] = |
98 mojo::TypeConverter<const std::vector<uint8_t>, int32_t>::Convert( | 98 mojo::TypeConverter<const std::vector<uint8_t>, int32_t>::Convert( |
99 static_cast<int32_t>(container)); | 99 static_cast<int32_t>(container)); |
100 } | 100 } |
101 } | 101 } |
102 | |
103 ui::ContextFactory* factory = aura::Env::GetInstance()->context_factory(); | |
msw
2016/02/09 18:31:26
This seems like a tangential workaround; care to a
sadrul
2016/02/10 08:04:41
Split into a separate CL: https://codereview.chrom
| |
104 aura::Env::GetInstance()->set_context_factory(nullptr); | |
102 views::NativeWidgetMus* native_widget = | 105 views::NativeWidgetMus* native_widget = |
103 static_cast<views::NativeWidgetMus*>( | 106 static_cast<views::NativeWidgetMus*>( |
104 views::WindowManagerConnection::Get()->CreateNativeWidgetMus( | 107 views::WindowManagerConnection::Get()->CreateNativeWidgetMus( |
105 properties, params, delegate)); | 108 properties, params, delegate)); |
109 aura::Env::GetInstance()->set_context_factory(factory); | |
110 | |
106 // TODO: Set the correct display id here. | 111 // TODO: Set the correct display id here. |
107 InitRootWindowSettings(native_widget->GetRootWindow())->display_id = | 112 InitRootWindowSettings(native_widget->GetRootWindow())->display_id = |
108 Shell::GetInstance() | 113 Shell::GetInstance() |
109 ->display_manager() | 114 ->display_manager() |
110 ->GetPrimaryDisplayCandidate() | 115 ->GetPrimaryDisplayCandidate() |
111 .id(); | 116 .id(); |
112 return native_widget; | 117 return native_widget; |
113 } | 118 } |
114 | 119 |
115 DISALLOW_COPY_AND_ASSIGN(NativeWidgetFactory); | 120 DISALLOW_COPY_AND_ASSIGN(NativeWidgetFactory); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 | 204 |
200 void SysUIApplication::Initialize(mojo::Shell* shell, | 205 void SysUIApplication::Initialize(mojo::Shell* shell, |
201 const std::string& url, | 206 const std::string& url, |
202 uint32_t id) { | 207 uint32_t id) { |
203 ash_init_.reset(new AshInit()); | 208 ash_init_.reset(new AshInit()); |
204 ash_init_->Initialize(shell); | 209 ash_init_->Initialize(shell); |
205 } | 210 } |
206 | 211 |
207 } // namespace sysui | 212 } // namespace sysui |
208 } // namespace ash | 213 } // namespace ash |
OLD | NEW |