OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BROWSER_MAC_INSTALL_FROM_DMG_H_ | 5 #ifndef CHROME_BROWSER_MAC_INSTALL_FROM_DMG_H_ |
6 #define CHROME_BROWSER_MAC_INSTALL_FROM_DMG_H_ | 6 #define CHROME_BROWSER_MAC_INSTALL_FROM_DMG_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include <string> |
| 10 |
9 // If the application is running from a read-only disk image, prompts the user | 11 // If the application is running from a read-only disk image, prompts the user |
10 // to install it to the hard drive. If the user approves, the application | 12 // to install it to the hard drive. If the user approves, the application |
11 // will be installed and launched, and MaybeInstallFromDiskImage will return | 13 // will be installed and launched, and MaybeInstallFromDiskImage will return |
12 // true. In that case, the caller must exit expeditiously. | 14 // true. In that case, the caller must exit expeditiously. |
13 bool MaybeInstallFromDiskImage(); | 15 bool MaybeInstallFromDiskImage(); |
14 | 16 |
| 17 // Given a BSD device name of the form "diskN" or "diskNsM" as used by IOKit, |
| 18 // where the device name corresponds to a disk image, unmounts all filesystems |
| 19 // on that disk image ("diskN", even if "diskNsM" was supplied), "ejects" the |
| 20 // disk image from the system, and places the disk image file into the Trash. |
| 21 // If at any step an error occurs, further processing is aborted. |
| 22 void EjectAndTrashDiskImage(const std::string& dmg_bsd_device_name); |
| 23 |
15 #endif // CHROME_BROWSER_MAC_INSTALL_FROM_DMG_H_ | 24 #endif // CHROME_BROWSER_MAC_INSTALL_FROM_DMG_H_ |
OLD | NEW |