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 #include "chrome_frame/chrome_launcher.h" | 5 #include "chrome_frame/chrome_launcher.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 switches::kEnableExperimentalExtensionApis, | 27 switches::kEnableExperimentalExtensionApis, |
28 switches::kNoErrorDialogs, | 28 switches::kNoErrorDialogs, |
29 switches::kNoFirstRun, | 29 switches::kNoFirstRun, |
30 switches::kUserDataDir, | 30 switches::kUserDataDir, |
31 }; | 31 }; |
32 | 32 |
33 CommandLine* CreateLaunchCommandLine() { | 33 CommandLine* CreateLaunchCommandLine() { |
34 // TODO(joi) As optimization, could launch Chrome directly when running at | 34 // TODO(joi) As optimization, could launch Chrome directly when running at |
35 // medium integrity. (Requires bringing in code to read SIDs, etc.) | 35 // medium integrity. (Requires bringing in code to read SIDs, etc.) |
36 | 36 |
37 // The launcher EXE will be in the same directory as the npchrome_tab DLL, | 37 // The launcher EXE will be in the same directory as the Chrome Frame DLL, |
38 // so create a full path to it based on this assumption. Since our unit | 38 // so create a full path to it based on this assumption. Since our unit |
39 // tests also use this function, and live in the directory above, we test | 39 // tests also use this function, and live in the directory above, we test |
40 // existence of the file and try the path that includes the /servers/ | 40 // existence of the file and try the path that includes the /servers/ |
41 // directory if needed. | 41 // directory if needed. |
42 FilePath module_path; | 42 FilePath module_path; |
43 if (PathService::Get(base::FILE_MODULE, &module_path)) { | 43 if (PathService::Get(base::FILE_MODULE, &module_path)) { |
44 FilePath current_dir = module_path.DirName(); | 44 FilePath current_dir = module_path.DirName(); |
45 FilePath same_dir_path = current_dir.Append(kLauncherExeBaseName); | 45 FilePath same_dir_path = current_dir.Append(kLauncherExeBaseName); |
46 if (file_util::PathExists(same_dir_path)) { | 46 if (file_util::PathExists(same_dir_path)) { |
47 return new CommandLine(same_dir_path); | 47 return new CommandLine(same_dir_path); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 return ERROR_OPEN_FAILED; | 116 return ERROR_OPEN_FAILED; |
117 } | 117 } |
118 } | 118 } |
119 | 119 |
120 // Compile-time check to see that the type CfLaunchChromeProc is correct. | 120 // Compile-time check to see that the type CfLaunchChromeProc is correct. |
121 #ifndef NODEBUG | 121 #ifndef NODEBUG |
122 namespace { | 122 namespace { |
123 chrome_launcher::CfLaunchChromeProc cf_launch_chrome = CfLaunchChrome; | 123 chrome_launcher::CfLaunchChromeProc cf_launch_chrome = CfLaunchChrome; |
124 } // namespace | 124 } // namespace |
125 #endif // NODEBUG | 125 #endif // NODEBUG |
OLD | NEW |