OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MOJO_SHELL_PROFILE_SERVICE_LOADER_H_ | |
6 #define MOJO_SHELL_PROFILE_SERVICE_LOADER_H_ | |
7 | |
8 #include <map> | |
9 | |
10 #include "base/containers/scoped_ptr_hash_map.h" | |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "mojo/public/cpp/application/application_delegate.h" | |
13 #include "mojo/service_manager/service_loader.h" | |
14 | |
15 namespace mojo { | |
16 | |
17 class ApplicationImpl; | |
18 | |
19 namespace shell { | |
20 | |
21 // ServiceLoader responsible for creating connections to the ProfileService. | |
22 class ProfileServiceLoader : public ServiceLoader, public ApplicationDelegate { | |
23 public: | |
24 ProfileServiceLoader(); | |
25 virtual ~ProfileServiceLoader(); | |
26 | |
27 private: | |
28 // ServiceLoader overrides: | |
29 virtual void LoadService( | |
30 ServiceManager* manager, | |
31 const GURL& url, | |
32 ScopedMessagePipeHandle shell_handle) OVERRIDE; | |
33 virtual void OnServiceError(ServiceManager* manager, | |
34 const GURL& url) OVERRIDE; | |
35 | |
36 // ApplicationDelegate overrides. | |
37 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) | |
38 MOJO_OVERRIDE; | |
39 | |
40 base::ScopedPtrHashMap<uintptr_t, ApplicationImpl> apps_; | |
41 | |
42 DISALLOW_COPY_AND_ASSIGN(ProfileServiceLoader); | |
43 }; | |
44 | |
45 } // namespace shell | |
46 } // namespace mojo | |
47 | |
48 #endif // MOJO_SHELL_PROFILE_SERVICE_LOADER_H_ | |
OLD | NEW |