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

Unified Diff: services/authentication/src/org/chromium/mojo/authentication/AuthenticationApp.java

Issue 1116653002: Introduce authentication service. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Follow review Created 5 years, 8 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
Index: services/authentication/src/org/chromium/mojo/authentication/AuthenticationApp.java
diff --git a/services/sensors/src/org/chromium/mojo/sensors/Sensors.java b/services/authentication/src/org/chromium/mojo/authentication/AuthenticationApp.java
similarity index 51%
copy from services/sensors/src/org/chromium/mojo/sensors/Sensors.java
copy to services/authentication/src/org/chromium/mojo/authentication/AuthenticationApp.java
index 526d78f208232bb375be5247abb4e53f684da6c1..3737648380773a3659f07402d5be94cd1987a369 100644
--- a/services/sensors/src/org/chromium/mojo/sensors/Sensors.java
+++ b/services/authentication/src/org/chromium/mojo/authentication/AuthenticationApp.java
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.chromium.mojo.sensors;
+package org.chromium.mojo.authentication;
import android.content.Context;
@@ -13,39 +13,45 @@ import org.chromium.mojo.application.ServiceFactoryBinder;
import org.chromium.mojo.system.Core;
import org.chromium.mojo.system.MessagePipeHandle;
import org.chromium.mojom.mojo.Shell;
-import org.chromium.mojom.sensors.SensorService;
/**
- * Android service application implementing the SensorService interface.
+ * Android service application implementing the AuthenticationService interface.
*/
-public class Sensors implements ApplicationDelegate {
- private Context mContext;
+public class AuthenticationApp implements ApplicationDelegate {
+ private final Context mContext;
+ private final Core mCore;
+ private Shell mShell;
- public Sensors(Context context) {
+ public AuthenticationApp(Context context, Core core) {
mContext = context;
+ mCore = core;
}
/**
- * @see ApplicationDelegate#initialize(Shell, String[], String)
- */
+ * @see ApplicationDelegate#initialize(Shell, String[], String)
+ */
@Override
- public void initialize(Shell shell, String[] args, String url) {}
+ public void initialize(Shell shell, String[] args, String url) {
+ mShell = shell;
+ }
/**
- * @see ApplicationDelegate#configureIncomingConnection(String, ApplicationConnection)
+ * @see ApplicationDelegate#configureIncomingConnection(ApplicationConnection)
*/
@Override
- public boolean configureIncomingConnection(
- final String requestorUrl, ApplicationConnection connection) {
- connection.addService(new ServiceFactoryBinder<SensorService>() {
+ public boolean configureIncomingConnection(final ApplicationConnection connection) {
+ connection.addService(new ServiceFactoryBinder<AuthenticationService>() {
+
@Override
public void bindNewInstanceToMessagePipe(MessagePipeHandle pipe) {
- SensorService.MANAGER.bind(new SensorServiceImpl(mContext), pipe);
+ AuthenticationService.MANAGER.bind(new AuthenticationServiceImpl(mContext, mCore,
+ connection.getRequestorUrl(), mShell),
+ pipe);
}
@Override
public String getInterfaceName() {
- return SensorService.MANAGER.getName();
+ return AuthenticationService.MANAGER.getName();
}
});
return true;
@@ -59,6 +65,6 @@ public class Sensors implements ApplicationDelegate {
public static void mojoMain(
Context context, Core core, MessagePipeHandle applicationRequestHandle) {
- ApplicationRunner.run(new Sensors(context), core, applicationRequestHandle);
+ ApplicationRunner.run(new AuthenticationApp(context, core), core, applicationRequestHandle);
}
}

Powered by Google App Engine
This is Rietveld 408576698