| 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/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "mash/public/interfaces/launchable.mojom.h" | 13 #include "mash/public/interfaces/launchable.mojom.h" |
| 14 #include "services/catalog/public/interfaces/catalog.mojom.h" | 14 #include "services/catalog/public/interfaces/catalog.mojom.h" |
| 15 #include "services/catalog/public/interfaces/constants.mojom.h" | 15 #include "services/catalog/public/interfaces/constants.mojom.h" |
| 16 #include "services/service_manager/public/c/main.h" | 16 #include "services/service_manager/public/c/main.h" |
| 17 #include "services/service_manager/public/cpp/connector.h" | 17 #include "services/service_manager/public/cpp/connector.h" |
| 18 #include "services/service_manager/public/cpp/interface_registry.h" | 18 #include "services/service_manager/public/cpp/interface_registry.h" |
| 19 #include "services/service_manager/public/cpp/service.h" | 19 #include "services/service_manager/public/cpp/service.h" |
| 20 #include "services/service_manager/public/cpp/service_context.h" | 20 #include "services/service_manager/public/cpp/service_context.h" |
| 21 #include "services/service_manager/public/cpp/service_runner.h" | 21 #include "services/service_manager/public/cpp/service_runner.h" |
| 22 #include "services/tracing/public/cpp/provider.h" | 22 #include "services/tracing/public/cpp/provider.h" |
| 23 #include "ui/aura/window.h" |
| 24 #include "ui/aura/window_tree_host.h" |
| 23 #include "ui/views/background.h" | 25 #include "ui/views/background.h" |
| 24 #include "ui/views/controls/textfield/textfield.h" | 26 #include "ui/views/controls/textfield/textfield.h" |
| 25 #include "ui/views/controls/textfield/textfield_controller.h" | 27 #include "ui/views/controls/textfield/textfield_controller.h" |
| 26 #include "ui/views/mus/aura_init.h" | 28 #include "ui/views/mus/aura_init.h" |
| 27 #include "ui/views/widget/widget.h" | 29 #include "ui/views/widget/widget.h" |
| 28 #include "ui/views/widget/widget_delegate.h" | 30 #include "ui/views/widget/widget_delegate.h" |
| 29 #include "url/gurl.h" | 31 #include "url/gurl.h" |
| 30 | 32 |
| 31 namespace mash { | 33 namespace mash { |
| 32 namespace quick_launch { | 34 namespace quick_launch { |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 if (reuse && !windows_.empty()) { | 194 if (reuse && !windows_.empty()) { |
| 193 windows_.back()->Activate(); | 195 windows_.back()->Activate(); |
| 194 return; | 196 return; |
| 195 } | 197 } |
| 196 catalog::mojom::CatalogPtr catalog; | 198 catalog::mojom::CatalogPtr catalog; |
| 197 context()->connector()->BindInterface(catalog::mojom::kServiceName, &catalog); | 199 context()->connector()->BindInterface(catalog::mojom::kServiceName, &catalog); |
| 198 | 200 |
| 199 views::Widget* window = views::Widget::CreateWindowWithContextAndBounds( | 201 views::Widget* window = views::Widget::CreateWindowWithContextAndBounds( |
| 200 new QuickLaunchUI(this, context()->connector(), std::move(catalog)), | 202 new QuickLaunchUI(this, context()->connector(), std::move(catalog)), |
| 201 nullptr, gfx::Rect(10, 640, 0, 0)); | 203 nullptr, gfx::Rect(10, 640, 0, 0)); |
| 204 window->GetNativeWindow()->GetHost()->window()->SetName("QuickLaunch"); |
| 202 window->Show(); | 205 window->Show(); |
| 203 windows_.push_back(window); | 206 windows_.push_back(window); |
| 204 } | 207 } |
| 205 | 208 |
| 206 void QuickLaunch::Create(const service_manager::Identity& remote_identity, | 209 void QuickLaunch::Create(const service_manager::Identity& remote_identity, |
| 207 ::mash::mojom::LaunchableRequest request) { | 210 ::mash::mojom::LaunchableRequest request) { |
| 208 bindings_.AddBinding(this, std::move(request)); | 211 bindings_.AddBinding(this, std::move(request)); |
| 209 } | 212 } |
| 210 | 213 |
| 211 } // namespace quick_launch | 214 } // namespace quick_launch |
| 212 } // namespace mash | 215 } // namespace mash |
| OLD | NEW |