| 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" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 14 #include "chrome/common/media_galleries/picasa_types.h" | 14 #include "chrome/common/media_galleries/picasa_types.h" |
| 15 #include "chrome/utility/utility_message_handler.h" | 15 #include "chrome/utility/utility_message_handler.h" |
| 16 #include "extensions/features/features.h" | 16 #include "extensions/features/features.h" |
| 17 #include "extensions/utility/utility_handler.h" | 17 #include "extensions/utility/utility_handler.h" |
| 18 | 18 |
| 19 #if !BUILDFLAG(ENABLE_EXTENSIONS) | 19 #if !BUILDFLAG(ENABLE_EXTENSIONS) |
| 20 #error "Extensions must be enabled" | 20 #error "Extensions must be enabled" |
| 21 #endif | 21 #endif |
| 22 | 22 |
| 23 class ChromeContentUtilityClient; | |
| 24 | |
| 25 namespace service_manager { | 23 namespace service_manager { |
| 26 class InterfaceRegistry; | 24 class InterfaceRegistry; |
| 27 } | 25 } |
| 28 | 26 |
| 29 namespace extensions { | 27 namespace extensions { |
| 30 | 28 |
| 31 // Dispatches IPCs for Chrome extensions utility messages. | 29 // Dispatches IPCs for Chrome extensions utility messages. |
| 32 class ExtensionsHandler : public UtilityMessageHandler { | 30 class ExtensionsHandler : public UtilityMessageHandler { |
| 33 public: | 31 public: |
| 34 ExtensionsHandler(); | 32 ExtensionsHandler(); |
| 35 ~ExtensionsHandler() override; | 33 ~ExtensionsHandler() override; |
| 36 | 34 |
| 37 static void PreSandboxStartup(); | 35 static void PreSandboxStartup(); |
| 38 | 36 |
| 39 // TODO(noel): consider moving this API to the UtilityMessageHandler | 37 // TODO(noel): consider moving this API to the UtilityMessageHandler |
| 40 // interface. | 38 // interface. |
| 41 static void ExposeInterfacesToBrowser( | 39 static void ExposeInterfacesToBrowser( |
| 42 service_manager::InterfaceRegistry* registry, | 40 service_manager::InterfaceRegistry* registry, |
| 43 ChromeContentUtilityClient* utility_client, | |
| 44 bool running_elevated); | 41 bool running_elevated); |
| 45 | 42 |
| 46 // UtilityMessageHandler: | 43 // UtilityMessageHandler: |
| 47 bool OnMessageReceived(const IPC::Message& message) override; | 44 bool OnMessageReceived(const IPC::Message& message) override; |
| 48 | 45 |
| 49 private: | 46 private: |
| 50 // IPC message handlers. | 47 // IPC message handlers. |
| 51 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
| 52 void OnParseITunesPrefXml(const std::string& itunes_xml_data); | 49 void OnParseITunesPrefXml(const std::string& itunes_xml_data); |
| 53 #endif // defined(OS_WIN) | 50 #endif // defined(OS_WIN) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 65 #endif // defined(OS_WIN) || defined(OS_MACOSX) | 62 #endif // defined(OS_WIN) || defined(OS_MACOSX) |
| 66 | 63 |
| 67 UtilityHandler utility_handler_; | 64 UtilityHandler utility_handler_; |
| 68 | 65 |
| 69 DISALLOW_COPY_AND_ASSIGN(ExtensionsHandler); | 66 DISALLOW_COPY_AND_ASSIGN(ExtensionsHandler); |
| 70 }; | 67 }; |
| 71 | 68 |
| 72 } // namespace extensions | 69 } // namespace extensions |
| 73 | 70 |
| 74 #endif // CHROME_UTILITY_EXTENSIONS_EXTENSIONS_HANDLER_H_ | 71 #endif // CHROME_UTILITY_EXTENSIONS_EXTENSIONS_HANDLER_H_ |
| OLD | NEW |