| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/extensions/api/messaging/native_process_launcher.h" | 5 #include "chrome/browser/extensions/api/messaging/native_process_launcher.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 // report the NOT_FOUND error. | 175 // report the NOT_FOUND error. |
| 176 if (!base::PathExists(host_path)) { | 176 if (!base::PathExists(host_path)) { |
| 177 LOG(ERROR) | 177 LOG(ERROR) |
| 178 << "Found manifest, but not the binary for native messaging host " | 178 << "Found manifest, but not the binary for native messaging host " |
| 179 << native_host_name << ". Host path specified in the manifest: " | 179 << native_host_name << ". Host path specified in the manifest: " |
| 180 << host_path.AsUTF8Unsafe(); | 180 << host_path.AsUTF8Unsafe(); |
| 181 PostErrorResult(callback, RESULT_NOT_FOUND); | 181 PostErrorResult(callback, RESULT_NOT_FOUND); |
| 182 return; | 182 return; |
| 183 } | 183 } |
| 184 | 184 |
| 185 CommandLine command_line(host_path); | 185 base::CommandLine command_line(host_path); |
| 186 command_line.AppendArg(origin.spec()); | 186 command_line.AppendArg(origin.spec()); |
| 187 | 187 |
| 188 // Pass handle of the native view window to the native messaging host. This | 188 // Pass handle of the native view window to the native messaging host. This |
| 189 // way the host will be able to create properly focused UI windows. | 189 // way the host will be able to create properly focused UI windows. |
| 190 #if defined(OS_WIN) | 190 #if defined(OS_WIN) |
| 191 command_line.AppendSwitchASCII(kParentWindowSwitchName, | 191 command_line.AppendSwitchASCII(kParentWindowSwitchName, |
| 192 base::Int64ToString(window_handle_)); | 192 base::Int64ToString(window_handle_)); |
| 193 #endif // !defined(OS_WIN) | 193 #endif // !defined(OS_WIN) |
| 194 | 194 |
| 195 base::Process process; | 195 base::Process process; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 intptr_t window_handle = 0; | 263 intptr_t window_handle = 0; |
| 264 #if defined(OS_WIN) | 264 #if defined(OS_WIN) |
| 265 window_handle = reinterpret_cast<intptr_t>( | 265 window_handle = reinterpret_cast<intptr_t>( |
| 266 views::HWNDForNativeView(native_view)); | 266 views::HWNDForNativeView(native_view)); |
| 267 #endif | 267 #endif |
| 268 return scoped_ptr<NativeProcessLauncher>( | 268 return scoped_ptr<NativeProcessLauncher>( |
| 269 new NativeProcessLauncherImpl(allow_user_level_hosts, window_handle)); | 269 new NativeProcessLauncherImpl(allow_user_level_hosts, window_handle)); |
| 270 } | 270 } |
| 271 | 271 |
| 272 } // namespace extensions | 272 } // namespace extensions |
| OLD | NEW |