OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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, one can't make shortcuts with command-line arguments. Instead, we | 5 // On Mac, one can't make shortcuts with command-line arguments. Instead, we |
6 // produce small app bundles which locate the Chromium framework and load it, | 6 // produce small app bundles which locate the Chromium framework and load it, |
7 // passing the appropriate data. This is the entry point into the framework for | 7 // passing the appropriate data. This is the entry point into the framework for |
8 // those app bundles. | 8 // those app bundles. |
9 | 9 |
10 #import <Cocoa/Cocoa.h> | 10 #import <Cocoa/Cocoa.h> |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 if (!ping_chrome_reply_received_) | 181 if (!ping_chrome_reply_received_) |
182 [NSApp terminate:nil]; | 182 [NSApp terminate:nil]; |
183 } | 183 } |
184 | 184 |
185 void AppShimController::Init() { | 185 void AppShimController::Init() { |
186 DCHECK(g_io_thread); | 186 DCHECK(g_io_thread); |
187 | 187 |
188 SetUpMenu(); | 188 SetUpMenu(); |
189 | 189 |
190 // Chrome will relaunch shims when relaunching apps. | 190 // Chrome will relaunch shims when relaunching apps. |
191 if (base::mac::IsOSLionOrLater()) | 191 [NSApp disableRelaunchOnLogin]; |
192 [NSApp disableRelaunchOnLogin]; | |
193 | 192 |
194 // The user_data_dir for shims actually contains the app_data_path. | 193 // The user_data_dir for shims actually contains the app_data_path. |
195 // I.e. <user_data_dir>/<profile_dir>/Web Applications/_crx_extensionid/ | 194 // I.e. <user_data_dir>/<profile_dir>/Web Applications/_crx_extensionid/ |
196 user_data_dir_ = g_info->user_data_dir.DirName().DirName().DirName(); | 195 user_data_dir_ = g_info->user_data_dir.DirName().DirName().DirName(); |
197 CHECK(!user_data_dir_.empty()); | 196 CHECK(!user_data_dir_.empty()); |
198 | 197 |
199 base::FilePath symlink_path = | 198 base::FilePath symlink_path = |
200 user_data_dir_.Append(app_mode::kAppShimSocketSymlinkName); | 199 user_data_dir_.Append(app_mode::kAppShimSocketSymlinkName); |
201 | 200 |
202 base::FilePath socket_path; | 201 base::FilePath socket_path; |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 // minute. | 699 // minute. |
701 main_message_loop.PostTask( | 700 main_message_loop.PostTask( |
702 FROM_HERE, | 701 FROM_HERE, |
703 base::Bind(&AppShimController::Init, | 702 base::Bind(&AppShimController::Init, |
704 base::Unretained(&controller))); | 703 base::Unretained(&controller))); |
705 } | 704 } |
706 | 705 |
707 main_message_loop.Run(); | 706 main_message_loop.Run(); |
708 return 0; | 707 return 0; |
709 } | 708 } |
OLD | NEW |