Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2743)

Unified Diff: chrome/browser/platform_util_linux.cc

Issue 352393002: Be explicit about target type in platform_util::OpenItem() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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) {

Powered by Google App Engine
This is Rietveld 408576698