OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_FRAME_CHROME_LAUNCHER_H_ | 5 #ifndef CHROME_FRAME_CHROME_LAUNCHER_H_ |
6 #define CHROME_FRAME_CHROME_LAUNCHER_H_ | 6 #define CHROME_FRAME_CHROME_LAUNCHER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/file_path.h" | |
11 | |
12 class CommandLine; | 10 class CommandLine; |
13 | 11 |
14 namespace chrome_launcher { | 12 namespace chrome_launcher { |
15 | 13 |
16 // The base name of the chrome_launcher.exe file. | 14 // The base name of the chrome_launcher.exe file. |
17 extern const wchar_t kLauncherExeBaseName[]; | 15 extern const wchar_t kLauncherExeBaseName[]; |
18 | 16 |
19 // Creates a command line suitable for launching Chrome. You can add any | 17 // Creates a command line suitable for launching Chrome. You can add any |
20 // flags needed before launching. | 18 // flags needed before launching. |
21 // | 19 // |
22 // The command-line may use the Chrome executable directly, or use an in-between | 20 // The command-line may use the Chrome executable directly, or use an in-between |
23 // process if needed for security/elevation purposes. You must delete the | 21 // process if needed for security/elevation purposes. You must delete the |
24 // returned command line. | 22 // returned command line. |
25 CommandLine* CreateLaunchCommandLine(); | 23 CommandLine* CreateLaunchCommandLine(); |
26 | 24 |
27 // Fills in a new command line from the flags on this process's command line | 25 // Fills in a new command line from the flags on this process's command line |
28 // that we are allowing Low Integrity to invoke. | 26 // that we are allowing Low Integrity to invoke. |
29 // | 27 // |
30 // Logs a warning for any flags that were passed that are not allowed to be | 28 // Logs a warning for any flags that were passed that are not allowed to be |
31 // invoked by Low Integrity. | 29 // invoked by Low Integrity. |
32 void SanitizeCommandLine(const CommandLine& original, CommandLine* sanitized); | 30 void SanitizeCommandLine(const CommandLine& original, CommandLine* sanitized); |
33 | 31 |
34 // Given a command-line without an initial program part, launch our associated | 32 // Given a command-line without an initial program part, launch our associated |
35 // chrome.exe with a sanitized version of that command line. Returns true iff | 33 // chrome.exe with a sanitized version of that command line. Returns true iff |
36 // successful. | 34 // successful. |
37 bool SanitizeAndLaunchChrome(const wchar_t* command_line); | 35 bool SanitizeAndLaunchChrome(const wchar_t* command_line); |
38 | 36 |
39 // Returns the full path to the Chrome executable. | 37 // Returns the full path to the Chrome executable. |
40 FilePath GetChromeExecutablePath(); | 38 std::wstring GetChromeExecutablePath(); |
41 | 39 |
42 // The type of the CfLaunchChrome entrypoint exported from this DLL. | 40 // The type of the CfLaunchChrome entrypoint exported from this DLL. |
43 typedef int (__stdcall *CfLaunchChromeProc)(); | 41 typedef int (__stdcall *CfLaunchChromeProc)(); |
44 | 42 |
45 } // namespace chrome_launcher | 43 } // namespace chrome_launcher |
46 | 44 |
47 #endif // CHROME_FRAME_CHROME_LAUNCHER_H_ | 45 #endif // CHROME_FRAME_CHROME_LAUNCHER_H_ |
OLD | NEW |