Chromium Code Reviews| Index: services/authentication/src/org/chromium/mojo/authentication/Authentication.java |
| diff --git a/services/sensors/src/org/chromium/mojo/sensors/Sensors.java b/services/authentication/src/org/chromium/mojo/authentication/Authentication.java |
| similarity index 51% |
| copy from services/sensors/src/org/chromium/mojo/sensors/Sensors.java |
| copy to services/authentication/src/org/chromium/mojo/authentication/Authentication.java |
| index 526d78f208232bb375be5247abb4e53f684da6c1..8cdc960cf002d63af01c654ba06f59c4ba69d507 100644 |
| --- a/services/sensors/src/org/chromium/mojo/sensors/Sensors.java |
| +++ b/services/authentication/src/org/chromium/mojo/authentication/Authentication.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 Authentication implements ApplicationDelegate { |
|
ppi
2015/04/29 13:32:23
Can we call this AuthenticationServiceApp or Authe
qsr
2015/04/29 14:22:20
Done.
|
| + private final Context mContext; |
| + private final Core mCore; |
| + private Shell mShell; |
| - public Sensors(Context context) { |
| + public Authentication(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 Authentication(context, core), core, applicationRequestHandle); |
| } |
| } |