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

Unified Diff: mash/app_driver/app_driver.cc

Issue 2179023004: Make Service own ServiceContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 months 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/app_driver/app_driver.h ('k') | mash/browser/browser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/app_driver/app_driver.cc
diff --git a/mash/app_driver/app_driver.cc b/mash/app_driver/app_driver.cc
index 2e549fa471f1e9051681d7efc93e05333c52a98e..b06b25863ed8c456bc48d164d06c8deafef27a63 100644
--- a/mash/app_driver/app_driver.cc
+++ b/mash/app_driver/app_driver.cc
@@ -57,8 +57,7 @@ void DoNothing() {}
} // namespace
-AppDriver::AppDriver()
- : connector_(nullptr), binding_(this), weak_factory_(this) {}
+AppDriver::AppDriver() : binding_(this), weak_factory_(this) {}
AppDriver::~AppDriver() {}
@@ -70,7 +69,7 @@ void AppDriver::OnAvailableCatalogEntries(
}
ui::mojom::AcceleratorRegistrarPtr registrar;
- connector_->ConnectToInterface(entries[0]->name, &registrar);
+ connector()->ConnectToInterface(entries[0]->name, &registrar);
if (binding_.is_bound())
binding_.Unbind();
@@ -88,10 +87,7 @@ void AppDriver::OnAvailableCatalogEntries(
}
}
-void AppDriver::OnStart(shell::Connector* connector,
- const shell::Identity& identity,
- uint32_t id) {
- connector_ = connector;
+void AppDriver::OnStart(const shell::Identity& identity) {
AddAccelerators();
}
@@ -129,12 +125,12 @@ void AppDriver::OnAccelerator(uint32_t id, std::unique_ptr<ui::Event> event) {
DCHECK(iter != options.end());
const LaunchOptions& entry = iter->second;
LaunchablePtr launchable;
- connector_->ConnectToInterface(entry.app, &launchable);
+ connector()->ConnectToInterface(entry.app, &launchable);
launchable->Launch(entry.option, entry.mode);
}
void AppDriver::AddAccelerators() {
- connector_->ConnectToInterface("mojo:catalog", &catalog_);
+ connector()->ConnectToInterface("mojo:catalog", &catalog_);
catalog_->GetEntriesProvidingClass(
"mus:window_manager", base::Bind(&AppDriver::OnAvailableCatalogEntries,
weak_factory_.GetWeakPtr()));
« no previous file with comments | « mash/app_driver/app_driver.h ('k') | mash/browser/browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698