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

Unified Diff: chrome/common/platform_util_linux.cc

Issue 112064: Linux: call xdg-open on downloaded files to open them. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix typos Created 11 years, 7 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
« no previous file with comments | « chrome/common/platform_util.h ('k') | chrome/common/platform_util_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/platform_util_linux.cc
===================================================================
--- chrome/common/platform_util_linux.cc (revision 17020)
+++ chrome/common/platform_util_linux.cc (working copy)
@@ -11,6 +11,18 @@
#include "base/process_util.h"
#include "base/string_util.h"
+namespace {
+
+void XDGOpen(const FilePath& path) {
+ std::vector<std::string> argv;
+ argv.push_back("xdg-open");
+ argv.push_back(path.value());
+ base::file_handle_mapping_vector no_files;
+ base::LaunchApp(argv, no_files, false, NULL);
+}
+
+} // namespace
+
namespace platform_util {
// TODO(estade): It would be nice to be able to select the file in the file
@@ -21,13 +33,13 @@
if (!file_util::DirectoryExists(dir))
return;
- std::vector<std::string> argv;
- argv.push_back("xdg-open");
- argv.push_back(dir.value());
- base::file_handle_mapping_vector no_files;
- base::LaunchApp(argv, no_files, false, NULL);
+ XDGOpen(dir);
}
+void OpenItem(const FilePath& full_path) {
+ XDGOpen(full_path);
+}
+
gfx::NativeWindow GetTopLevel(gfx::NativeView view) {
// A detached widget won't have a toplevel window as an ancestor, so we can't
// assume that the query for toplevel will return a window.
« no previous file with comments | « chrome/common/platform_util.h ('k') | chrome/common/platform_util_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698