| 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 #include "extensions/utility/utility_handler.h" | 5 #include "extensions/utility/utility_handler.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "content/public/utility/utility_thread.h" | 9 #include "content/public/utility/utility_thread.h" |
| 10 #include "extensions/common/constants.h" | 10 #include "extensions/common/constants.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 std::string lang = command_line->GetSwitchValueASCII(switches::kLang); | 113 std::string lang = command_line->GetSwitchValueASCII(switches::kLang); |
| 114 if (!lang.empty()) | 114 if (!lang.empty()) |
| 115 extension_l10n_util::SetProcessLocale(lang); | 115 extension_l10n_util::SetProcessLocale(lang); |
| 116 } | 116 } |
| 117 | 117 |
| 118 // static | 118 // static |
| 119 void UtilityHandler::ExposeInterfacesToBrowser( | 119 void UtilityHandler::ExposeInterfacesToBrowser( |
| 120 service_manager::InterfaceRegistry* registry, | 120 service_manager::InterfaceRegistry* registry, |
| 121 bool running_elevated) { | 121 bool running_elevated) { |
| 122 // If our process runs with elevated privileges, only add elevated Mojo | 122 // If our process runs with elevated privileges, only add elevated Mojo |
| 123 // services to the interface registry. | 123 // interfaces to the interface registry. |
| 124 if (running_elevated) | 124 if (running_elevated) |
| 125 return; | 125 return; |
| 126 | 126 |
| 127 registry->AddInterface(base::Bind(&ExtensionUnpackerImpl::Create)); | 127 registry->AddInterface(base::Bind(&ExtensionUnpackerImpl::Create)); |
| 128 } | 128 } |
| 129 | 129 |
| 130 bool UtilityHandler::OnMessageReceived(const IPC::Message& message) { | 130 bool UtilityHandler::OnMessageReceived(const IPC::Message& message) { |
| 131 bool handled = true; | 131 bool handled = true; |
| 132 IPC_BEGIN_MESSAGE_MAP(UtilityHandler, message) | 132 IPC_BEGIN_MESSAGE_MAP(UtilityHandler, message) |
| 133 IPC_MESSAGE_HANDLER(ExtensionUtilityMsg_ParseUpdateManifest, | 133 IPC_MESSAGE_HANDLER(ExtensionUtilityMsg_ParseUpdateManifest, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 145 manifest.errors())); | 145 manifest.errors())); |
| 146 } else { | 146 } else { |
| 147 content::UtilityThread::Get()->Send( | 147 content::UtilityThread::Get()->Send( |
| 148 new ExtensionUtilityHostMsg_ParseUpdateManifest_Succeeded( | 148 new ExtensionUtilityHostMsg_ParseUpdateManifest_Succeeded( |
| 149 manifest.results())); | 149 manifest.results())); |
| 150 } | 150 } |
| 151 content::UtilityThread::Get()->ReleaseProcessIfNeeded(); | 151 content::UtilityThread::Get()->ReleaseProcessIfNeeded(); |
| 152 } | 152 } |
| 153 | 153 |
| 154 } // namespace extensions | 154 } // namespace extensions |
| OLD | NEW |