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 "mash/quick_launch/quick_launch.h" | 5 #include "mash/quick_launch/quick_launch.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 tracing_.Initialize(connector(), identity.name()); | 167 tracing_.Initialize(connector(), identity.name()); |
168 | 168 |
169 aura_init_.reset( | 169 aura_init_.reset( |
170 new views::AuraInit(connector(), "views_mus_resources.pak")); | 170 new views::AuraInit(connector(), "views_mus_resources.pak")); |
171 window_manager_connection_ = | 171 window_manager_connection_ = |
172 views::WindowManagerConnection::Create(connector(), identity); | 172 views::WindowManagerConnection::Create(connector(), identity); |
173 | 173 |
174 Launch(mojom::kWindow, mojom::LaunchMode::MAKE_NEW); | 174 Launch(mojom::kWindow, mojom::LaunchMode::MAKE_NEW); |
175 } | 175 } |
176 | 176 |
177 bool QuickLaunch::OnConnect(shell::Connection* connection) { | 177 bool QuickLaunch::OnConnect(const shell::Identity& remote_identity, |
178 connection->AddInterface<mojom::Launchable>(this); | 178 shell::InterfaceRegistry* registry) { |
| 179 registry->AddInterface<mojom::Launchable>(this); |
179 return true; | 180 return true; |
180 } | 181 } |
181 | 182 |
182 void QuickLaunch::Launch(uint32_t what, mojom::LaunchMode how) { | 183 void QuickLaunch::Launch(uint32_t what, mojom::LaunchMode how) { |
183 bool reuse = how == mojom::LaunchMode::REUSE || | 184 bool reuse = how == mojom::LaunchMode::REUSE || |
184 how == mojom::LaunchMode::DEFAULT; | 185 how == mojom::LaunchMode::DEFAULT; |
185 if (reuse && !windows_.empty()) { | 186 if (reuse && !windows_.empty()) { |
186 windows_.back()->Activate(); | 187 windows_.back()->Activate(); |
187 return; | 188 return; |
188 } | 189 } |
189 catalog::mojom::CatalogPtr catalog; | 190 catalog::mojom::CatalogPtr catalog; |
190 connector()->ConnectToInterface("mojo:catalog", &catalog); | 191 connector()->ConnectToInterface("mojo:catalog", &catalog); |
191 | 192 |
192 views::Widget* window = views::Widget::CreateWindowWithContextAndBounds( | 193 views::Widget* window = views::Widget::CreateWindowWithContextAndBounds( |
193 new QuickLaunchUI(this, connector(), std::move(catalog)), | 194 new QuickLaunchUI(this, connector(), std::move(catalog)), |
194 nullptr, gfx::Rect(10, 640, 0, 0)); | 195 nullptr, gfx::Rect(10, 640, 0, 0)); |
195 window->Show(); | 196 window->Show(); |
196 windows_.push_back(window); | 197 windows_.push_back(window); |
197 } | 198 } |
198 | 199 |
199 void QuickLaunch::Create(const shell::Identity& remote_identity, | 200 void QuickLaunch::Create(const shell::Identity& remote_identity, |
200 mojom::LaunchableRequest request) { | 201 mojom::LaunchableRequest request) { |
201 bindings_.AddBinding(this, std::move(request)); | 202 bindings_.AddBinding(this, std::move(request)); |
202 } | 203 } |
203 | 204 |
204 } // namespace quick_launch | 205 } // namespace quick_launch |
205 } // namespace mash | 206 } // namespace mash |
OLD | NEW |