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 #import "chrome/browser/web_applications/web_app_mac.h" | 5 #import "chrome/browser/web_applications/web_app_mac.h" |
6 | 6 |
7 #import <Carbon/Carbon.h> | 7 #import <Carbon/Carbon.h> |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <utility> | 11 #include <utility> |
12 | 12 |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/files/file_enumerator.h" | 14 #include "base/files/file_enumerator.h" |
15 #include "base/files/file_util.h" | 15 #include "base/files/file_util.h" |
16 #include "base/files/scoped_temp_dir.h" | 16 #include "base/files/scoped_temp_dir.h" |
17 #include "base/mac/foundation_util.h" | 17 #include "base/mac/foundation_util.h" |
18 #include "base/mac/launch_services_util.h" | 18 #import "base/mac/launch_services_util.h" |
19 #include "base/mac/mac_util.h" | 19 #include "base/mac/mac_util.h" |
20 #include "base/mac/scoped_cftyperef.h" | 20 #include "base/mac/scoped_cftyperef.h" |
21 #include "base/mac/scoped_nsobject.h" | 21 #include "base/mac/scoped_nsobject.h" |
22 #include "base/macros.h" | 22 #include "base/macros.h" |
23 #include "base/memory/ref_counted.h" | 23 #include "base/memory/ref_counted.h" |
24 #include "base/metrics/sparse_histogram.h" | 24 #include "base/metrics/sparse_histogram.h" |
25 #include "base/path_service.h" | 25 #include "base/path_service.h" |
26 #include "base/process/process_handle.h" | 26 #include "base/process/process_handle.h" |
27 #include "base/strings/string16.h" | 27 #include "base/strings/string16.h" |
28 #include "base/strings/string_number_conversions.h" | 28 #include "base/strings/string_number_conversions.h" |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 | 270 |
271 if (!base::PathExists(shim_path)) | 271 if (!base::PathExists(shim_path)) |
272 return; | 272 return; |
273 | 273 |
274 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); | 274 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); |
275 command_line.AppendSwitchASCII( | 275 command_line.AppendSwitchASCII( |
276 app_mode::kLaunchedByChromeProcessId, | 276 app_mode::kLaunchedByChromeProcessId, |
277 base::IntToString(base::GetCurrentProcId())); | 277 base::IntToString(base::GetCurrentProcId())); |
278 if (launched_after_rebuild) | 278 if (launched_after_rebuild) |
279 command_line.AppendSwitch(app_mode::kLaunchedAfterRebuild); | 279 command_line.AppendSwitch(app_mode::kLaunchedAfterRebuild); |
280 // Launch without activating (kLSLaunchDontSwitch). | 280 // Launch without activating (NSWorkspaceLaunchWithoutActivation). |
281 base::mac::OpenApplicationWithPath( | 281 base::mac::OpenApplicationWithPath( |
282 shim_path, command_line, kLSLaunchDefaults | kLSLaunchDontSwitch, NULL); | 282 shim_path, command_line, |
| 283 NSWorkspaceLaunchDefault | NSWorkspaceLaunchWithoutActivation); |
283 } | 284 } |
284 | 285 |
285 base::FilePath GetAppLoaderPath() { | 286 base::FilePath GetAppLoaderPath() { |
286 return base::mac::PathForFrameworkBundleResource( | 287 return base::mac::PathForFrameworkBundleResource( |
287 base::mac::NSToCFCast(@"app_mode_loader.app")); | 288 base::mac::NSToCFCast(@"app_mode_loader.app")); |
288 } | 289 } |
289 | 290 |
290 void UpdatePlatformShortcutsInternal( | 291 void UpdatePlatformShortcutsInternal( |
291 const base::FilePath& app_data_path, | 292 const base::FilePath& app_data_path, |
292 const base::string16& old_app_title, | 293 const base::string16& old_app_title, |
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1176 BuildShortcutInfoFromBundle(*it); | 1177 BuildShortcutInfoFromBundle(*it); |
1177 WebAppShortcutCreator shortcut_creator(it->DirName(), shortcut_info.get(), | 1178 WebAppShortcutCreator shortcut_creator(it->DirName(), shortcut_info.get(), |
1178 extensions::FileHandlersInfo()); | 1179 extensions::FileHandlersInfo()); |
1179 shortcut_creator.DeleteShortcuts(); | 1180 shortcut_creator.DeleteShortcuts(); |
1180 } | 1181 } |
1181 } | 1182 } |
1182 | 1183 |
1183 } // namespace internals | 1184 } // namespace internals |
1184 | 1185 |
1185 } // namespace web_app | 1186 } // namespace web_app |
OLD | NEW |