Index: chrome/browser/platform_util_win.cc |
=================================================================== |
--- chrome/browser/platform_util_win.cc (revision 108523) |
+++ chrome/browser/platform_util_win.cc (working copy) |
@@ -9,6 +9,7 @@ |
#include <shellapi.h> |
#include <shlobj.h> |
+#include "base/bind.h" |
#include "base/file_path.h" |
#include "base/file_util.h" |
#include "base/logging.h" |
@@ -17,13 +18,17 @@ |
#include "base/win/registry.h" |
#include "base/win/scoped_co_mem.h" |
#include "base/win/scoped_comptr.h" |
+#include "content/public/browser/browser_thread.h" |
#include "googleurl/src/gurl.h" |
#include "ui/base/win/shell.h" |
#include "ui/gfx/native_widget_types.h" |
+using content::BrowserThread; |
+ |
namespace platform_util { |
void ShowItemInFolder(const FilePath& full_path) { |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
FilePath dir = full_path.DirName(); |
// ParseDisplayName will fail if the directory is "C:", it must be "C:\\". |
if (dir.value() == L"" || !file_util::EnsureEndsWithSeparator(&dir)) |
@@ -108,6 +113,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)); |
ui::win::OpenItemViaShell(full_path); |
} |