Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: mash/quick_launch/quick_launch.cc

Issue 2576533003: Converts some services to use aura-mus (Closed)
Patch Set: remove log Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mash/quick_launch/quick_launch.h ('k') | mash/task_viewer/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/views/background.h" 23 #include "ui/views/background.h"
24 #include "ui/views/controls/textfield/textfield.h" 24 #include "ui/views/controls/textfield/textfield.h"
25 #include "ui/views/controls/textfield/textfield_controller.h" 25 #include "ui/views/controls/textfield/textfield_controller.h"
26 #include "ui/views/mus/aura_init.h" 26 #include "ui/views/mus/aura_init.h"
27 #include "ui/views/mus/window_manager_connection.h" 27 #include "ui/views/widget/widget.h"
28 #include "ui/views/widget/widget_delegate.h" 28 #include "ui/views/widget/widget_delegate.h"
29 #include "url/gurl.h" 29 #include "url/gurl.h"
30 30
31 namespace views {
32 class AuraInit;
33 }
34
35 namespace mash { 31 namespace mash {
36 namespace quick_launch { 32 namespace quick_launch {
37 33
38 class QuickLaunchUI : public views::WidgetDelegateView, 34 class QuickLaunchUI : public views::WidgetDelegateView,
39 public views::TextfieldController { 35 public views::TextfieldController {
40 public: 36 public:
41 QuickLaunchUI(QuickLaunch* quick_launch, 37 QuickLaunchUI(QuickLaunch* quick_launch,
42 service_manager::Connector* connector, 38 service_manager::Connector* connector,
43 catalog::mojom::CatalogPtr catalog) 39 catalog::mojom::CatalogPtr catalog)
44 : quick_launch_(quick_launch), 40 : quick_launch_(quick_launch),
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 DCHECK(it != windows_.end()); 163 DCHECK(it != windows_.end());
168 windows_.erase(it); 164 windows_.erase(it);
169 if (windows_.empty() && base::MessageLoop::current()->is_running()) 165 if (windows_.empty() && base::MessageLoop::current()->is_running())
170 base::MessageLoop::current()->QuitWhenIdle(); 166 base::MessageLoop::current()->QuitWhenIdle();
171 } 167 }
172 168
173 void QuickLaunch::OnStart() { 169 void QuickLaunch::OnStart() {
174 tracing_.Initialize(context()->connector(), context()->identity().name()); 170 tracing_.Initialize(context()->connector(), context()->identity().name());
175 171
176 aura_init_ = base::MakeUnique<views::AuraInit>( 172 aura_init_ = base::MakeUnique<views::AuraInit>(
177 context()->connector(), context()->identity(), "views_mus_resources.pak"); 173 context()->connector(), context()->identity(), "views_mus_resources.pak",
178 window_manager_connection_ = views::WindowManagerConnection::Create( 174 std::string(), nullptr, views::AuraInit::Mode::AURA_MUS);
179 context()->connector(), context()->identity());
180 175
181 Launch(mojom::kWindow, mojom::LaunchMode::MAKE_NEW); 176 Launch(mojom::kWindow, mojom::LaunchMode::MAKE_NEW);
182 } 177 }
183 178
184 bool QuickLaunch::OnConnect(const service_manager::ServiceInfo& remote_info, 179 bool QuickLaunch::OnConnect(const service_manager::ServiceInfo& remote_info,
185 service_manager::InterfaceRegistry* registry) { 180 service_manager::InterfaceRegistry* registry) {
186 registry->AddInterface<::mash::mojom::Launchable>(this); 181 registry->AddInterface<::mash::mojom::Launchable>(this);
187 return true; 182 return true;
188 } 183 }
189 184
(...skipping 15 matching lines...) Expand all
205 windows_.push_back(window); 200 windows_.push_back(window);
206 } 201 }
207 202
208 void QuickLaunch::Create(const service_manager::Identity& remote_identity, 203 void QuickLaunch::Create(const service_manager::Identity& remote_identity,
209 ::mash::mojom::LaunchableRequest request) { 204 ::mash::mojom::LaunchableRequest request) {
210 bindings_.AddBinding(this, std::move(request)); 205 bindings_.AddBinding(this, std::move(request));
211 } 206 }
212 207
213 } // namespace quick_launch 208 } // namespace quick_launch
214 } // namespace mash 209 } // namespace mash
OLDNEW
« no previous file with comments | « mash/quick_launch/quick_launch.h ('k') | mash/task_viewer/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698