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