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.
5 #ifndef CHROME_UTILITY_EXTENSIONS_EXTENSIONS_HANDLER_H_
6 #define CHROME_UTILITY_EXTENSIONS_EXTENSIONS_HANDLER_H_
8 #include "base/base64.h"
9 #include "base/compiler_specific.h"
10 #include "base/macros.h"
11 #include "chrome/common/media_galleries/picasa_types.h"
12 #include "chrome/utility/utility_message_handler.h"
13 #include "extensions/utility/utility_handler.h"
15 #if !defined(ENABLE_EXTENSIONS)
16 #error "Extensions must be enabled"
20 class MediaMetadataParser
;
23 namespace extensions
{
25 // Dispatches IPCs for Chrome extensions utility messages.
26 class ExtensionsHandler
: public UtilityMessageHandler
{
29 ~ExtensionsHandler() override
;
31 static void PreSandboxStartup();
33 // UtilityMessageHandler:
34 bool OnMessageReceived(const IPC::Message
& message
) override
;
37 // IPC message handlers.
38 void OnUnzipToDir(const base::FilePath
& zip_path
, const base::FilePath
& dir
);
39 void OnCheckMediaFile(int64 milliseconds_of_decoding
,
40 const IPC::PlatformFileForTransit
& media_file
);
43 void OnParseITunesPrefXml(const std::string
& itunes_xml_data
);
44 #endif // defined(OS_WIN)
46 #if defined(OS_MACOSX)
47 void OnParseIPhotoLibraryXmlFile(
48 const IPC::PlatformFileForTransit
& iphoto_library_file
);
49 #endif // defined(OS_MACOSX)
51 #if defined(OS_WIN) || defined(OS_MACOSX)
52 void OnParseITunesLibraryXmlFile(
53 const IPC::PlatformFileForTransit
& itunes_library_file
);
55 void OnParsePicasaPMPDatabase(
56 const picasa::AlbumTableFilesForTransit
& album_table_files
);
58 void OnIndexPicasaAlbumsContents(
59 const picasa::AlbumUIDSet
& album_uids
,
60 const std::vector
<picasa::FolderINIContents
>& folders_inis
);
61 #endif // defined(OS_WIN) || defined(OS_MACOSX)
64 void OnGetWiFiCredentials(const std::string
& network_guid
);
65 #endif // defined(OS_WIN)
67 UtilityHandler utility_handler_
;
69 DISALLOW_COPY_AND_ASSIGN(ExtensionsHandler
);
72 } // namespace extensions
74 #endif // CHROME_UTILITY_EXTENSIONS_EXTENSIONS_HANDLER_H_