summaryrefslogtreecommitdiffstats
path: root/chrome/browser/platform_util_chromeos.cc
diff options
context:
space:
mode:
authorhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-22 12:39:28 +0000
committerhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-22 12:39:28 +0000
commitedf99a22752ff9e505fce52de5ffe56af288136d (patch)
tree4d20f4a7453b980a209374861b46333a925a7740 /chrome/browser/platform_util_chromeos.cc
parent358ace8e623c8bc999da8e6a1d8a55c8f103430f (diff)
downloadchromium_src-edf99a22752ff9e505fce52de5ffe56af288136d.zip
chromium_src-edf99a22752ff9e505fce52de5ffe56af288136d.tar.gz
chromium_src-edf99a22752ff9e505fce52de5ffe56af288136d.tar.bz2
chromeos: Check if the path given to platform_util::OpenItem is a directory or not, in file_manager_util.cc
file_manager_util::ViewFile and ViewFolder are merged into one function, ViewItem. Now file_manager_util::ViewItem is responsible to investigate if the given path is directory or not. Use FileSystemOperation::DirectoryExists, instead of file_util::DirectoryExists, to correctly handle Drive paths. BUG=149725 TEST=Open chrome://downloads and click 'Open downloads folder' to see the download folder is opened. Once with 'Download location' set to Downloads in chrome://settings, once more with set to Google Drive. TBR=ben@chromium.org for chrome/browser/platform_util_chromeos.cc Review URL: https://chromiumcodereview.appspot.com/12034005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178004 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/platform_util_chromeos.cc')
-rw-r--r--chrome/browser/platform_util_chromeos.cc18
1 files changed, 1 insertions, 17 deletions
diff --git a/chrome/browser/platform_util_chromeos.cc b/chrome/browser/platform_util_chromeos.cc
index 7a9e7e7..2821510 100644
--- a/chrome/browser/platform_util_chromeos.cc
+++ b/chrome/browser/platform_util_chromeos.cc
@@ -5,9 +5,6 @@
#include "chrome/browser/platform_util.h"
#include "base/bind.h"
-#include "base/callback.h"
-#include "base/file_util.h"
-#include "base/utf_string_conversions.h"
#include "chrome/browser/chromeos/extensions/file_manager_util.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/browser_finder.h"
@@ -19,23 +16,11 @@
using content::BrowserThread;
-class Profile;
-
namespace {
const char kGmailComposeUrl[] =
"https://mail.google.com/mail/?extsrc=mailto&url=";
-void OpenItemOnFileThread(const FilePath& full_path) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
- base::Closure callback;
- if (file_util::DirectoryExists(full_path))
- callback = base::Bind(&file_manager_util::ViewFolder, full_path);
- else
- callback = base::Bind(&file_manager_util::ViewFile, full_path);
- BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, callback);
-}
-
void OpenURL(const std::string& url) {
// TODO(beng): improve this to locate context from call stack.
Browser* browser = chrome::FindOrCreateTabbedBrowser(
@@ -58,8 +43,7 @@ void ShowItemInFolder(const FilePath& full_path) {
void OpenItem(const FilePath& full_path) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
- base::Bind(&OpenItemOnFileThread, full_path));
+ file_manager_util::ViewItem(full_path);
}
void OpenExternal(const GURL& url) {