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 EXTENSIONS_UTILITY_UTILITY_HANDLER_H_ | 5 #ifndef EXTENSIONS_UTILITY_UTILITY_HANDLER_H_ |
6 #define EXTENSIONS_UTILITY_UTILITY_HANDLER_H_ | 6 #define EXTENSIONS_UTILITY_UTILITY_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | |
11 #include "base/macros.h" | 10 #include "base/macros.h" |
12 | 11 |
13 namespace base { | |
14 class FilePath; | |
15 } | |
16 | |
17 namespace IPC { | 12 namespace IPC { |
18 class Message; | 13 class Message; |
19 } | 14 } |
20 | 15 |
| 16 namespace service_manager { |
| 17 class InterfaceRegistry; |
| 18 } |
| 19 |
21 namespace extensions { | 20 namespace extensions { |
22 | 21 |
23 // A handler for extensions-related IPC from within utility processes. | 22 // A handler for extensions-related IPC from within utility processes. |
24 class UtilityHandler { | 23 class UtilityHandler { |
25 public: | 24 public: |
26 UtilityHandler(); | 25 UtilityHandler(); |
27 ~UtilityHandler(); | 26 ~UtilityHandler(); |
28 | 27 |
29 static void UtilityThreadStarted(); | 28 static void UtilityThreadStarted(); |
30 | 29 |
| 30 static void ExposeInterfacesToBrowser( |
| 31 service_manager::InterfaceRegistry* registry, |
| 32 bool running_elevated); |
| 33 |
31 bool OnMessageReceived(const IPC::Message& message); | 34 bool OnMessageReceived(const IPC::Message& message); |
32 | 35 |
33 private: | 36 private: |
34 // IPC message handlers. | 37 // IPC message handlers. |
35 void OnParseUpdateManifest(const std::string& xml); | 38 void OnParseUpdateManifest(const std::string& xml); |
36 void OnUnzipToDir(const base::FilePath& zip_path, const base::FilePath& dir); | |
37 void OnUnpackExtension(const base::FilePath& directory_path, | |
38 const std::string& extension_id, | |
39 int location, | |
40 int creation_flags); | |
41 | 39 |
42 DISALLOW_COPY_AND_ASSIGN(UtilityHandler); | 40 DISALLOW_COPY_AND_ASSIGN(UtilityHandler); |
43 }; | 41 }; |
44 | 42 |
45 } // namespace extensions | 43 } // namespace extensions |
46 | 44 |
47 #endif // EXTENSIONS_UTILITY_UTILITY_HANDLER_H_ | 45 #endif // EXTENSIONS_UTILITY_UTILITY_HANDLER_H_ |
OLD | NEW |