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 OnDecodeImageBase64(const std::string
& encoded_data
);
40 void OnCheckMediaFile(int64 milliseconds_of_decoding
,
41 const IPC::PlatformFileForTransit
& media_file
);
44 void OnParseITunesPrefXml(const std::string
& itunes_xml_data
);
45 #endif // defined(OS_WIN)
47 #if defined(OS_MACOSX)
48 void OnParseIPhotoLibraryXmlFile(
49 const IPC::PlatformFileForTransit
& iphoto_library_file
);
50 #endif // defined(OS_MACOSX)
52 #if defined(OS_WIN) || defined(OS_MACOSX)
53 void OnParseITunesLibraryXmlFile(
54 const IPC::PlatformFileForTransit
& itunes_library_file
);
56 void OnParsePicasaPMPDatabase(
57 const picasa::AlbumTableFilesForTransit
& album_table_files
);
59 void OnIndexPicasaAlbumsContents(
60 const picasa::AlbumUIDSet
& album_uids
,
61 const std::vector
<picasa::FolderINIContents
>& folders_inis
);
62 #endif // defined(OS_WIN) || defined(OS_MACOSX)
65 void OnGetWiFiCredentials(const std::string
& network_guid
);
66 #endif // defined(OS_WIN)
68 UtilityHandler utility_handler_
;
70 DISALLOW_COPY_AND_ASSIGN(ExtensionsHandler
);
73 } // namespace extensions
75 #endif // CHROME_UTILITY_EXTENSIONS_EXTENSIONS_HANDLER_H_