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 CHROME_UTILITY_EXTENSIONS_EXTENSIONS_HANDLER_H_ | 5 #ifndef CHROME_UTILITY_EXTENSIONS_EXTENSIONS_HANDLER_H_ |
6 #define CHROME_UTILITY_EXTENSIONS_EXTENSIONS_HANDLER_H_ | 6 #define CHROME_UTILITY_EXTENSIONS_EXTENSIONS_HANDLER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
11 #include "base/compiler_specific.h" | |
12 #include "base/macros.h" | 11 #include "base/macros.h" |
13 #include "build/build_config.h" | 12 #include "build/build_config.h" |
14 #include "chrome/common/media_galleries/picasa_types.h" | 13 #include "chrome/common/media_galleries/picasa_types.h" |
15 #include "chrome/utility/utility_message_handler.h" | 14 #include "chrome/utility/utility_message_handler.h" |
16 #include "extensions/features/features.h" | 15 #include "extensions/features/features.h" |
17 #include "extensions/utility/utility_handler.h" | 16 #include "extensions/utility/utility_handler.h" |
18 | 17 |
19 #if !BUILDFLAG(ENABLE_EXTENSIONS) | 18 #if !BUILDFLAG(ENABLE_EXTENSIONS) |
20 #error "Extensions must be enabled" | 19 #error "Extensions must be enabled" |
21 #endif | 20 #endif |
22 | 21 |
23 namespace service_manager { | 22 namespace service_manager { |
24 class InterfaceRegistry; | 23 class InterfaceRegistry; |
25 } | 24 } |
26 | 25 |
27 namespace extensions { | 26 namespace extensions { |
28 | 27 |
29 // Dispatches IPCs for Chrome extensions utility messages. | 28 // IPC handler for chrome extensions utility messages. |
| 29 // Note: these IPC are deprecated so there is no need to convert |
| 30 // them to mojo. https://crbug.com/680928 |
30 class ExtensionsHandler : public UtilityMessageHandler { | 31 class ExtensionsHandler : public UtilityMessageHandler { |
31 public: | 32 public: |
32 ExtensionsHandler(); | 33 ExtensionsHandler(); |
33 ~ExtensionsHandler() override; | 34 ~ExtensionsHandler() override; |
34 | 35 |
35 static void PreSandboxStartup(); | 36 static void PreSandboxStartup(); |
36 | 37 |
37 // TODO(noel): consider moving this API to the UtilityMessageHandler | |
38 // interface. | |
39 static void ExposeInterfacesToBrowser( | 38 static void ExposeInterfacesToBrowser( |
40 service_manager::InterfaceRegistry* registry, | 39 service_manager::InterfaceRegistry* registry, |
41 bool running_elevated); | 40 bool running_elevated); |
42 | 41 |
43 // UtilityMessageHandler: | 42 // UtilityMessageHandler: |
44 bool OnMessageReceived(const IPC::Message& message) override; | 43 bool OnMessageReceived(const IPC::Message& message) override; |
45 | 44 |
46 private: | 45 private: |
47 // IPC message handlers. | |
48 #if defined(OS_WIN) | 46 #if defined(OS_WIN) |
49 void OnParseITunesPrefXml(const std::string& itunes_xml_data); | 47 void OnParseITunesPrefXml(const std::string& itunes_xml_data); |
50 #endif // defined(OS_WIN) | 48 #endif // defined(OS_WIN) |
51 | 49 |
52 #if defined(OS_WIN) || defined(OS_MACOSX) | 50 #if defined(OS_WIN) || defined(OS_MACOSX) |
53 void OnParseITunesLibraryXmlFile( | 51 void OnParseITunesLibraryXmlFile( |
54 const IPC::PlatformFileForTransit& itunes_library_file); | 52 const IPC::PlatformFileForTransit& itunes_library_file); |
55 | 53 |
56 void OnParsePicasaPMPDatabase( | 54 void OnParsePicasaPMPDatabase( |
57 const picasa::AlbumTableFilesForTransit& album_table_files); | 55 const picasa::AlbumTableFilesForTransit& album_table_files); |
58 | 56 |
59 void OnIndexPicasaAlbumsContents( | 57 void OnIndexPicasaAlbumsContents( |
60 const picasa::AlbumUIDSet& album_uids, | 58 const picasa::AlbumUIDSet& album_uids, |
61 const std::vector<picasa::FolderINIContents>& folders_inis); | 59 const std::vector<picasa::FolderINIContents>& folders_inis); |
62 #endif // defined(OS_WIN) || defined(OS_MACOSX) | 60 #endif // defined(OS_WIN) || defined(OS_MACOSX) |
63 | 61 |
64 UtilityHandler utility_handler_; | |
65 | |
66 DISALLOW_COPY_AND_ASSIGN(ExtensionsHandler); | 62 DISALLOW_COPY_AND_ASSIGN(ExtensionsHandler); |
67 }; | 63 }; |
68 | 64 |
69 } // namespace extensions | 65 } // namespace extensions |
70 | 66 |
71 #endif // CHROME_UTILITY_EXTENSIONS_EXTENSIONS_HANDLER_H_ | 67 #endif // CHROME_UTILITY_EXTENSIONS_EXTENSIONS_HANDLER_H_ |
OLD | NEW |