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 // On Mac, shortcuts can't have command-line arguments. Instead, produce small | 5 // On Mac, shortcuts can't have command-line arguments. Instead, produce small |
6 // app bundles which locate the Chromium framework and load it, passing the | 6 // app bundles which locate the Chromium framework and load it, passing the |
7 // appropriate data. This is the code for such an app bundle. It should be kept | 7 // appropriate data. This is the code for such an app bundle. It should be kept |
8 // minimal and do as little work as possible (with as much work done on | 8 // minimal and do as little work as possible (with as much work done on |
9 // framework side as possible). | 9 // framework side as possible). |
10 | 10 |
11 #include <dlfcn.h> | 11 #include <dlfcn.h> |
12 | 12 |
13 #include <CoreFoundation/CoreFoundation.h> | 13 #include <CoreFoundation/CoreFoundation.h> |
14 #import <Foundation/Foundation.h> | 14 #import <Foundation/Foundation.h> |
15 | 15 |
16 #include "base/command_line.h" | 16 #include "base/command_line.h" |
17 #include "base/file_util.h" | |
18 #include "base/files/file_path.h" | 17 #include "base/files/file_path.h" |
| 18 #include "base/files/file_util.h" |
19 #include "base/logging.h" | 19 #include "base/logging.h" |
20 #include "base/mac/foundation_util.h" | 20 #include "base/mac/foundation_util.h" |
21 #include "base/mac/launch_services_util.h" | 21 #include "base/mac/launch_services_util.h" |
22 #include "base/mac/scoped_nsautorelease_pool.h" | 22 #include "base/mac/scoped_nsautorelease_pool.h" |
23 #include "base/process/launch.h" | 23 #include "base/process/launch.h" |
24 #include "base/strings/sys_string_conversions.h" | 24 #include "base/strings/sys_string_conversions.h" |
25 #include "chrome/common/chrome_switches.h" | 25 #include "chrome/common/chrome_switches.h" |
26 #import "chrome/common/mac/app_mode_chrome_locator.h" | 26 #import "chrome/common/mac/app_mode_chrome_locator.h" |
27 #include "chrome/common/mac/app_mode_common.h" | 27 #include "chrome/common/mac/app_mode_common.h" |
28 | 28 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 // Hard coded info parameters. | 173 // Hard coded info parameters. |
174 info.major_version = app_mode::kCurrentChromeAppModeInfoMajorVersion; | 174 info.major_version = app_mode::kCurrentChromeAppModeInfoMajorVersion; |
175 info.minor_version = app_mode::kCurrentChromeAppModeInfoMinorVersion; | 175 info.minor_version = app_mode::kCurrentChromeAppModeInfoMinorVersion; |
176 info.argc = argc; | 176 info.argc = argc; |
177 info.argv = argv; | 177 info.argv = argv; |
178 | 178 |
179 // Exit instead of returning to avoid the the removal of |main()| from stack | 179 // Exit instead of returning to avoid the the removal of |main()| from stack |
180 // backtraces under tail call optimization. | 180 // backtraces under tail call optimization. |
181 exit(LoadFrameworkAndStart(&info)); | 181 exit(LoadFrameworkAndStart(&info)); |
182 } | 182 } |
OLD | NEW |