Chromium Code Reviews| Index: chrome/browser/platform_util_linux.cc |
| =================================================================== |
| --- chrome/browser/platform_util_linux.cc (revision 108523) |
| +++ chrome/browser/platform_util_linux.cc (working copy) |
| @@ -6,12 +6,16 @@ |
| #include <gtk/gtk.h> |
| +#include "base/bind.h" |
| #include "base/file_util.h" |
| #include "base/process_util.h" |
| #include "base/utf_string_conversions.h" |
| #include "content/common/process_watcher.h" |
| +#include "content/public/browser/browser_thread.h" |
| #include "googleurl/src/gurl.h" |
| +using content::BrowserThread; |
| + |
| namespace { |
| void XDGUtil(const std::string& util, const std::string& arg) { |
| @@ -58,6 +62,7 @@ |
| // manager, but that probably requires extending xdg-open. For now just |
| // show the folder. |
| void ShowItemInFolder(const FilePath& full_path) { |
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
|
Randy Smith (Not in Mondays)
2011/11/08 22:27:55
Should we add something into the header file indic
achuithb
2011/11/09 00:26:27
Done.
|
| FilePath dir = full_path.DirName(); |
| if (!file_util::DirectoryExists(dir)) |
| return; |
| @@ -66,6 +71,13 @@ |
| } |
| void OpenItem(const FilePath& full_path) { |
| + if (!BrowserThread::CurrentlyOn(BrowserThread::FILE)) { |
| + BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
| + base::Bind(&OpenItem, full_path)); |
| + return; |
| + } |
| + |
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| XDGOpen(full_path.value()); |
| } |