| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 MOJO_SERVICES_TEST_SERVICE_TEST_REQUEST_TRACKER_APPLICATION_H_ | 5 #ifndef MOJO_SERVICES_TEST_SERVICE_TEST_REQUEST_TRACKER_APPLICATION_H_ |
| 6 #define MOJO_SERVICES_TEST_SERVICE_TEST_REQUEST_TRACKER_APPLICATION_H_ | 6 #define MOJO_SERVICES_TEST_SERVICE_TEST_REQUEST_TRACKER_APPLICATION_H_ |
| 7 | 7 |
| 8 #include "mojo/public/cpp/application/application_delegate.h" | 8 #include "mojo/public/cpp/application/application_delegate.h" |
| 9 #include "mojo/public/cpp/application/context_interface_provider.h" |
| 10 #include "mojo/public/cpp/application/interface_provider.h" |
| 9 #include "mojo/public/cpp/system/macros.h" | 11 #include "mojo/public/cpp/system/macros.h" |
| 10 #include "mojo/services/test_service/test_request_tracker_impl.h" | 12 #include "mojo/services/test_service/test_request_tracker_impl.h" |
| 11 | 13 |
| 12 namespace mojo { | 14 namespace mojo { |
| 13 namespace test { | 15 namespace test { |
| 16 class TestTimeService; |
| 14 | 17 |
| 15 // Embeds TestRequestTracker mojo services into an application. | 18 // Embeds TestRequestTracker mojo services into an application. |
| 16 class TestRequestTrackerApplication : public ApplicationDelegate { | 19 class TestRequestTrackerApplication |
| 20 : public ApplicationDelegate, |
| 21 public InterfaceProvider<TestTimeService> { |
| 17 public: | 22 public: |
| 18 TestRequestTrackerApplication(); | 23 TestRequestTrackerApplication(); |
| 19 virtual ~TestRequestTrackerApplication(); | 24 virtual ~TestRequestTrackerApplication(); |
| 20 | 25 |
| 26 // ApplicationDelegate methods: |
| 21 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) | 27 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) |
| 22 MOJO_OVERRIDE; | 28 MOJO_OVERRIDE; |
| 23 | 29 |
| 30 // InterfaceProvider<TestTimeService> methods: |
| 31 virtual void BindToRequest(ApplicationConnection* connection, |
| 32 InterfaceRequest<TestTimeService> request) |
| 33 MOJO_OVERRIDE; |
| 34 |
| 24 private: | 35 private: |
| 25 TrackingContext context_; | 36 TrackingContext context_; |
| 37 typedef ContextInterfaceProvider<TestTrackedRequestServiceImpl, |
| 38 TrackingContext> TestTrackedRequestProvider; |
| 39 TestTrackedRequestProvider test_tracked_request_provider_; |
| 40 typedef ContextInterfaceProvider<TestRequestTrackerImpl, TrackingContext> |
| 41 TestRequestTrackerProvider; |
| 42 TestRequestTrackerProvider test_request_tracker_provider_; |
| 26 MOJO_DISALLOW_COPY_AND_ASSIGN(TestRequestTrackerApplication); | 43 MOJO_DISALLOW_COPY_AND_ASSIGN(TestRequestTrackerApplication); |
| 27 }; | 44 }; |
| 28 | 45 |
| 29 } // namespace test | 46 } // namespace test |
| 30 } // namespace mojo | 47 } // namespace mojo |
| 31 | 48 |
| 32 #endif // MOJO_SERVICES_TEST_SERVICE_TEST_REQUEST_TRACKER_APPLICATION_H_ | 49 #endif // MOJO_SERVICES_TEST_SERVICE_TEST_REQUEST_TRACKER_APPLICATION_H_ |
| OLD | NEW |