OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.mojo.speech_recognizer; | 5 package org.chromium.mojo.speech_recognizer; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 | 8 |
9 import org.chromium.mojo.application.ApplicationConnection; | 9 import org.chromium.mojo.application.ApplicationConnection; |
10 import org.chromium.mojo.application.ApplicationDelegate; | 10 import org.chromium.mojo.application.ApplicationDelegate; |
11 import org.chromium.mojo.application.ApplicationRunner; | |
12 import org.chromium.mojo.application.ServiceFactoryBinder; | 11 import org.chromium.mojo.application.ServiceFactoryBinder; |
13 import org.chromium.mojo.bindings.InterfaceRequest; | 12 import org.chromium.mojo.bindings.InterfaceRequest; |
14 import org.chromium.mojo.system.Core; | |
15 import org.chromium.mojo.system.MessagePipeHandle; | |
16 import org.chromium.mojom.mojo.Shell; | 13 import org.chromium.mojom.mojo.Shell; |
17 | 14 |
18 /** | 15 /** |
19 * An ApplicationDelegate for the SpeechRecognizer service. | 16 * An ApplicationDelegate for the SpeechRecognizer service. |
20 */ | 17 */ |
21 final class SpeechRecognizerApplicationDelegate implements ApplicationDelegate { | 18 final class SpeechRecognizerApplicationDelegate implements ApplicationDelegate { |
22 private Context mContext; | 19 private Context mContext; |
23 | 20 |
24 public SpeechRecognizerApplicationDelegate(Context context) { | 21 public SpeechRecognizerApplicationDelegate(Context context) { |
25 mContext = context; | 22 mContext = context; |
(...skipping 23 matching lines...) Expand all Loading... |
49 } | 46 } |
50 }); | 47 }); |
51 return true; | 48 return true; |
52 } | 49 } |
53 | 50 |
54 /** | 51 /** |
55 * @see ApplicationDelegate#quit() | 52 * @see ApplicationDelegate#quit() |
56 */ | 53 */ |
57 @Override | 54 @Override |
58 public void quit() {} | 55 public void quit() {} |
59 | 56 } |
60 public static void mojoMain( | |
61 Context context, Core core, MessagePipeHandle applicationRequestHand
le) { | |
62 ApplicationRunner.run( | |
63 new SpeechRecognizerApplicationDelegate(context), core, applicat
ionRequestHandle); | |
64 } | |
65 } | |
OLD | NEW |