Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / chrome / utility / extensions / extensions_handler.h
blobbc06a10096b734b10a8d01477b4e224f5393bad4
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/json/json_reader.h"
11 #include "base/macros.h"
12 #include "chrome/common/media_galleries/picasa_types.h"
13 #include "chrome/utility/utility_message_handler.h"
15 #if !defined(ENABLE_EXTENSIONS)
16 #error "Extensions must be enabled"
17 #endif
19 namespace metadata {
20 class MediaMetadataParser;
23 namespace extensions {
25 // Dispatches IPCs for printing.
26 class ExtensionsHandler : public UtilityMessageHandler {
27 public:
28 ExtensionsHandler();
29 virtual ~ExtensionsHandler();
31 static void PreSandboxStartup();
32 static void UtilityThreadStarted();
34 // IPC::Listener:
35 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
37 private:
38 // IPC message handlers.
39 void OnUnpackExtension(const base::FilePath& extension_path,
40 const std::string& extension_id,
41 int location, int creation_flags);
42 void OnUnzipToDir(const base::FilePath& zip_path, const base::FilePath& dir);
43 void OnParseUpdateManifest(const std::string& xml);
44 void OnDecodeImageBase64(const std::string& encoded_data);
45 void OnParseJSON(const std::string& json);
46 void OnCheckMediaFile(int64 milliseconds_of_decoding,
47 const IPC::PlatformFileForTransit& media_file);
49 #if defined(OS_WIN)
50 void OnParseITunesPrefXml(const std::string& itunes_xml_data);
51 #endif // defined(OS_WIN)
53 #if defined(OS_MACOSX)
54 void OnParseIPhotoLibraryXmlFile(
55 const IPC::PlatformFileForTransit& iphoto_library_file);
56 #endif // defined(OS_MACOSX)
58 #if defined(OS_WIN) || defined(OS_MACOSX)
59 void OnParseITunesLibraryXmlFile(
60 const IPC::PlatformFileForTransit& itunes_library_file);
62 void OnParsePicasaPMPDatabase(
63 const picasa::AlbumTableFilesForTransit& album_table_files);
65 void OnIndexPicasaAlbumsContents(
66 const picasa::AlbumUIDSet& album_uids,
67 const std::vector<picasa::FolderINIContents>& folders_inis);
68 #endif // defined(OS_WIN) || defined(OS_MACOSX)
70 #if defined(OS_WIN)
71 void OnGetAndEncryptWiFiCredentials(const std::string& network_guid,
72 const std::vector<uint8>& public_key);
73 #endif // defined(OS_WIN)
75 DISALLOW_COPY_AND_ASSIGN(ExtensionsHandler);
78 } // namespace extensions
80 #endif // CHROME_UTILITY_EXTENSIONS_EXTENSIONS_HANDLER_H_