Chromium Code Reviews| Index: chrome/browser/platform_util_linux.cc |
| diff --git a/chrome/browser/platform_util_linux.cc b/chrome/browser/platform_util_linux.cc |
| index c94f8fed2a3d3d3bd7e10c96cf4c900a54d9f58a..32160cd3ebfc11a764fe7c23b7b3e1ea5b00d399 100644 |
| --- a/chrome/browser/platform_util_linux.cc |
| +++ b/chrome/browser/platform_util_linux.cc |
| @@ -9,11 +9,14 @@ |
| #include "base/process/kill.h" |
| #include "base/process/launch.h" |
| #include "base/strings/utf_string_conversions.h" |
| +#include "chrome/browser/platform_util_internal.h" |
| #include "content/public/browser/browser_thread.h" |
| #include "url/gurl.h" |
| using content::BrowserThread; |
| +namespace platform_util { |
| + |
| namespace { |
| void XDGUtil(const std::string& util, const std::string& arg) { |
| @@ -50,31 +53,21 @@ void XDGEmail(const std::string& email) { |
| XDGUtil("xdg-email", email); |
| } |
| -// TODO(estade): It would be nice to be able to select the file in the file |
| -// manager, but that probably requires extending xdg-open. For now just |
| -// show the folder. |
| -void ShowItemInFolderOnFileThread(const base::FilePath& full_path) { |
| - base::FilePath dir = full_path.DirName(); |
| - if (!base::DirectoryExists(dir)) |
| - return; |
| - |
| - XDGOpen(dir.value()); |
| -} |
| - |
| } // namespace |
| -namespace platform_util { |
| +namespace internal { |
| -void ShowItemInFolder(Profile* profile, const base::FilePath& full_path) { |
| - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| - BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
| - base::Bind(&ShowItemInFolderOnFileThread, full_path)); |
| +void PlatformOpenVerifiedItem(const base::FilePath& path, OpenItemType) { |
| + XDGOpen(path.value()); |
|
rickyz (no longer on Chrome)
2015/02/04 23:19:30
Now that https://codereview.chromium.org/885423003
asanka
2015/02/05 18:07:25
Did so. PTAL?
|
| +} |
| } |
| -void OpenItem(Profile* profile, const base::FilePath& full_path) { |
| +void ShowItemInFolder(Profile* profile, const base::FilePath& full_path) { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| - BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
| - base::Bind(&XDGOpen, full_path.value())); |
| + // TODO(estade): It would be nice to be able to select the file in the file |
| + // manager, but that probably requires extending xdg-open. For now just show |
| + // the folder. |
| + OpenFolder(profile, full_path.DirName(), OpenOperationCallback()); |
| } |
| void OpenExternal(Profile* profile, const GURL& url) { |