| 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 #ifndef SERVICES_PREDICTION_PREDICTION_SERVICE_IMPL_H_ | 5 #ifndef SERVICES_PREDICTION_PREDICTION_SERVICE_IMPL_H_ |
| 6 #define SERVICES_PREDICTION_PREDICTION_SERVICE_IMPL_H_ | 6 #define SERVICES_PREDICTION_PREDICTION_SERVICE_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "mojo/public/cpp/application/application_delegate.h" |
| 10 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 9 #include "mojo/services/prediction/interfaces/prediction.mojom.h" | 11 #include "mojo/services/prediction/interfaces/prediction.mojom.h" |
| 12 #include "services/prediction/dictionary_service.h" |
| 10 | 13 |
| 11 namespace prediction { | 14 namespace prediction { |
| 12 | 15 |
| 13 class PredictionServiceImpl : public PredictionService { | 16 class PredictionServiceImpl : public PredictionService { |
| 14 public: | 17 public: |
| 15 explicit PredictionServiceImpl( | 18 explicit PredictionServiceImpl( |
| 16 mojo::InterfaceRequest<PredictionService> request); | 19 mojo::InterfaceRequest<PredictionService> request); |
| 17 ~PredictionServiceImpl() override; | 20 ~PredictionServiceImpl() override; |
| 18 | 21 |
| 19 // PredictionService implementation | 22 // PredictionService implementation |
| 20 void GetPredictionList(PredictionInfoPtr prediction_info, | 23 void GetPredictionList(PredictionInfoPtr prediction_info, |
| 21 const GetPredictionListCallback& callback) override; | 24 const GetPredictionListCallback& callback) override; |
| 22 | 25 |
| 23 private: | 26 private: |
| 24 mojo::StrongBinding<PredictionService> strong_binding_; | 27 mojo::StrongBinding<PredictionService> strong_binding_; |
| 25 | 28 |
| 26 scoped_ptr<latinime::ProximityInfo> proximity_settings_; | 29 scoped_ptr<latinime::ProximityInfo> proximity_settings_; |
| 27 DictionaryService dictionary_service_; | 30 DictionaryService dictionary_service_; |
| 28 | 31 |
| 29 DISALLOW_COPY_AND_ASSIGN(PredictionServiceImpl); | 32 DISALLOW_COPY_AND_ASSIGN(PredictionServiceImpl); |
| 30 }; | 33 }; |
| 31 | 34 |
| 32 class PredictionServiceDelegate | 35 class PredictionServiceDelegate : public mojo::ApplicationDelegate { |
| 33 : public mojo::ApplicationDelegate, | |
| 34 public mojo::InterfaceFactory<PredictionService> { | |
| 35 public: | 36 public: |
| 36 PredictionServiceDelegate(); | 37 PredictionServiceDelegate(); |
| 37 ~PredictionServiceDelegate() override; | 38 ~PredictionServiceDelegate() override; |
| 38 | 39 |
| 39 // mojo::ApplicationDelegate implementation | 40 // mojo::ApplicationDelegate implementation |
| 40 bool ConfigureIncomingConnection( | 41 bool ConfigureIncomingConnection( |
| 41 mojo::ApplicationConnection* connection) override; | 42 mojo::ApplicationConnection* connection) override; |
| 42 | |
| 43 // mojo::InterfaceRequest<PredictionService> implementation | |
| 44 void Create(const mojo::ConnectionContext& connection_context, | |
| 45 mojo::InterfaceRequest<PredictionService> request) override; | |
| 46 }; | 43 }; |
| 47 | 44 |
| 48 } // namespace prediction | 45 } // namespace prediction |
| 49 | 46 |
| 50 #endif // SERVICES_PREDICTION_PREDICTION_SERVICE_IMPL_H_ | 47 #endif // SERVICES_PREDICTION_PREDICTION_SERVICE_IMPL_H_ |
| OLD | NEW |