| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/common/platform_util.h" | 5 #include "chrome/common/platform_util.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> |
| 8 |
| 7 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 8 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| 9 #include "base/process_util.h" | 11 #include "base/process_util.h" |
| 10 | 12 |
| 11 namespace platform_util { | 13 namespace platform_util { |
| 12 | 14 |
| 13 // TODO(estade): It would be nice to be able to select the file in the file | 15 // TODO(estade): It would be nice to be able to select the file in the file |
| 14 // manager, but that probably requires extending xdg-open. For now just | 16 // manager, but that probably requires extending xdg-open. For now just |
| 15 // show the folder. | 17 // show the folder. |
| 16 void ShowItemInFolder(const FilePath& full_path) { | 18 void ShowItemInFolder(const FilePath& full_path) { |
| 17 FilePath dir = full_path.DirName(); | 19 FilePath dir = full_path.DirName(); |
| 18 if (!file_util::DirectoryExists(dir)) | 20 if (!file_util::DirectoryExists(dir)) |
| 19 return; | 21 return; |
| 20 | 22 |
| 21 std::vector<std::string> argv; | 23 std::vector<std::string> argv; |
| 22 argv.push_back("xdg-open"); | 24 argv.push_back("xdg-open"); |
| 23 argv.push_back(dir.value()); | 25 argv.push_back(dir.value()); |
| 24 base::file_handle_mapping_vector no_files; | 26 base::file_handle_mapping_vector no_files; |
| 25 base::LaunchApp(argv, no_files, false, NULL); | 27 base::LaunchApp(argv, no_files, false, NULL); |
| 26 } | 28 } |
| 27 | 29 |
| 30 gfx::NativeWindow GetTopLevel(gfx::NativeView view) { |
| 31 return GTK_WINDOW(gtk_widget_get_toplevel(view)); |
| 32 } |
| 33 |
| 28 } // namespace platform_util | 34 } // namespace platform_util |
| OLD | NEW |