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

Unified Diff: mash/quick_launch/quick_launch.cc

Issue 2476063002: Service Manager: Rework Service and ServiceContext lifetime (Closed)
Patch Set: . Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mash/quick_launch/quick_launch.h ('k') | mash/screenlock/screenlock.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/quick_launch/quick_launch.cc
diff --git a/mash/quick_launch/quick_launch.cc b/mash/quick_launch/quick_launch.cc
index e5e5e4cea2142771b119957e0a9fd003c95f90c6..c8bcbbfdd7c2d2fc862dce3644c745c61c32f178 100644
--- a/mash/quick_launch/quick_launch.cc
+++ b/mash/quick_launch/quick_launch.cc
@@ -14,7 +14,9 @@
#include "services/catalog/public/interfaces/catalog.mojom.h"
#include "services/service_manager/public/c/main.h"
#include "services/service_manager/public/cpp/connector.h"
+#include "services/service_manager/public/cpp/interface_registry.h"
#include "services/service_manager/public/cpp/service.h"
+#include "services/service_manager/public/cpp/service_context.h"
#include "services/service_manager/public/cpp/service_runner.h"
#include "services/tracing/public/cpp/provider.h"
#include "ui/views/background.h"
@@ -164,13 +166,14 @@ void QuickLaunch::RemoveWindow(views::Widget* window) {
base::MessageLoop::current()->QuitWhenIdle();
}
-void QuickLaunch::OnStart(const service_manager::ServiceInfo& info) {
- tracing_.Initialize(connector(), info.identity.name());
+void QuickLaunch::OnStart(service_manager::ServiceContext* context) {
+ context_ = context;
+ tracing_.Initialize(context->connector(), context->identity().name());
- aura_init_ = base::MakeUnique<views::AuraInit>(connector(), info.identity,
- "views_mus_resources.pak");
- window_manager_connection_ =
- views::WindowManagerConnection::Create(connector(), info.identity);
+ aura_init_ = base::MakeUnique<views::AuraInit>(
+ context->connector(), context->identity(), "views_mus_resources.pak");
+ window_manager_connection_ = views::WindowManagerConnection::Create(
+ context->connector(), context->identity());
Launch(mojom::kWindow, mojom::LaunchMode::MAKE_NEW);
}
@@ -189,10 +192,10 @@ void QuickLaunch::Launch(uint32_t what, mojom::LaunchMode how) {
return;
}
catalog::mojom::CatalogPtr catalog;
- connector()->ConnectToInterface("service:catalog", &catalog);
+ context_->connector()->ConnectToInterface("service:catalog", &catalog);
views::Widget* window = views::Widget::CreateWindowWithContextAndBounds(
- new QuickLaunchUI(this, connector(), std::move(catalog)),
+ new QuickLaunchUI(this, context_->connector(), std::move(catalog)),
nullptr, gfx::Rect(10, 640, 0, 0));
window->Show();
windows_.push_back(window);
« no previous file with comments | « mash/quick_launch/quick_launch.h ('k') | mash/screenlock/screenlock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698