2014-10-31 21:17:05 +03:00
|
|
|
// Copyright (c) 2013 GitHub, Inc.
|
2014-04-25 13:49:37 +04:00
|
|
|
// Use of this source code is governed by the MIT license that can be
|
2013-04-29 16:41:11 +04:00
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef ATOM_COMMON_PLATFORM_UTIL_H_
|
|
|
|
#define ATOM_COMMON_PLATFORM_UTIL_H_
|
|
|
|
|
|
|
|
class GURL;
|
|
|
|
|
|
|
|
namespace base {
|
|
|
|
class FilePath;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace platform_util {
|
|
|
|
|
|
|
|
// Show the given file in a file manager. If possible, select the file.
|
|
|
|
// Must be called from the UI thread.
|
|
|
|
void ShowItemInFolder(const base::FilePath& full_path);
|
|
|
|
|
|
|
|
// Open the given file in the desktop's default manner.
|
|
|
|
// Must be called from the UI thread.
|
|
|
|
void OpenItem(const base::FilePath& full_path);
|
|
|
|
|
|
|
|
// Open the given external protocol URL in the desktop's default manner.
|
|
|
|
// (For example, mailto: URLs in the default mail user agent.)
|
2016-02-17 02:55:37 +03:00
|
|
|
bool OpenExternal(const GURL& url, bool activate);
|
2013-04-29 16:41:11 +04:00
|
|
|
|
2013-04-29 17:57:05 +04:00
|
|
|
// Move a file to trash.
|
2015-03-27 16:01:57 +03:00
|
|
|
bool MoveItemToTrash(const base::FilePath& full_path);
|
2013-04-29 17:57:05 +04:00
|
|
|
|
2013-04-29 18:10:03 +04:00
|
|
|
void Beep();
|
|
|
|
|
2013-05-01 11:42:30 +04:00
|
|
|
} // namespace platform_util
|
2013-04-29 16:41:11 +04:00
|
|
|
|
|
|
|
#endif // ATOM_COMMON_PLATFORM_UTIL_H_
|