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

Unified Diff: mash/example/window_type_launcher/window_type_launcher.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/example/window_type_launcher/window_type_launcher.h ('k') | mash/init/init.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/example/window_type_launcher/window_type_launcher.cc
diff --git a/mash/example/window_type_launcher/window_type_launcher.cc b/mash/example/window_type_launcher/window_type_launcher.cc
index dfe52234cfbb19e789198763f9f867391b2a9bae..dad28d6f77267bc507fc1d5bca396e8863dc3685 100644
--- a/mash/example/window_type_launcher/window_type_launcher.cc
+++ b/mash/example/window_type_launcher/window_type_launcher.cc
@@ -16,7 +16,9 @@
#include "services/service_manager/public/c/main.h"
#include "services/service_manager/public/cpp/connection.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/ui/public/cpp/property_type_converters.h"
#include "ui/aura/window.h"
@@ -470,11 +472,12 @@ void WindowTypeLauncher::RemoveWindow(views::Widget* window) {
base::MessageLoop::current()->QuitWhenIdle();
}
-void WindowTypeLauncher::OnStart(const service_manager::ServiceInfo& info) {
- aura_init_ = base::MakeUnique<views::AuraInit>(connector(), info.identity,
- "views_mus_resources.pak");
- window_manager_connection_ =
- views::WindowManagerConnection::Create(connector(), info.identity);
+void WindowTypeLauncher::OnStart(service_manager::ServiceContext* context) {
+ context_ = context;
+ aura_init_ = base::MakeUnique<views::AuraInit>(
+ context->connector(), context->identity(), "views_mus_resources.pak");
+ window_manager_connection_ = views::WindowManagerConnection::Create(
+ context->connector(), context->identity());
}
bool WindowTypeLauncher::OnConnect(
@@ -493,7 +496,7 @@ void WindowTypeLauncher::Launch(uint32_t what, mash::mojom::LaunchMode how) {
}
views::Widget* window = new views::Widget;
views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
- params.delegate = new WindowTypeLauncherView(this, connector());
+ params.delegate = new WindowTypeLauncherView(this, context_->connector());
window->Init(params);
window->Show();
windows_.push_back(window);
« no previous file with comments | « mash/example/window_type_launcher/window_type_launcher.h ('k') | mash/init/init.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698