Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(856)

Side by Side Diff: chrome/browser/extensions/api/messaging/native_process_launcher.cc

Issue 819133004: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698