| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/shell_integration_linux.h" | 5 #include "chrome/browser/shell_integration_linux.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <glib.h> | 8 #include <glib.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <sys/stat.h> | 10 #include <sys/stat.h> |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 616 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 617 | 617 |
| 618 std::vector<base::FilePath> search_paths = GetDataSearchLocations(env); | 618 std::vector<base::FilePath> search_paths = GetDataSearchLocations(env); |
| 619 | 619 |
| 620 for (std::vector<base::FilePath>::const_iterator i = search_paths.begin(); | 620 for (std::vector<base::FilePath>::const_iterator i = search_paths.begin(); |
| 621 i != search_paths.end(); ++i) { | 621 i != search_paths.end(); ++i) { |
| 622 base::FilePath path = i->Append("applications").Append(desktop_filename); | 622 base::FilePath path = i->Append("applications").Append(desktop_filename); |
| 623 VLOG(1) << "Looking for desktop file in " << path.value(); | 623 VLOG(1) << "Looking for desktop file in " << path.value(); |
| 624 if (base::PathExists(path)) { | 624 if (base::PathExists(path)) { |
| 625 VLOG(1) << "Found desktop file at " << path.value(); | 625 VLOG(1) << "Found desktop file at " << path.value(); |
| 626 return file_util::ReadFileToString(path, output); | 626 return base::ReadFileToString(path, output); |
| 627 } | 627 } |
| 628 } | 628 } |
| 629 | 629 |
| 630 return false; | 630 return false; |
| 631 } | 631 } |
| 632 | 632 |
| 633 base::FilePath GetWebShortcutFilename(const GURL& url) { | 633 base::FilePath GetWebShortcutFilename(const GURL& url) { |
| 634 // Use a prefix, because xdg-desktop-menu requires it. | 634 // Use a prefix, because xdg-desktop-menu requires it. |
| 635 std::string filename = | 635 std::string filename = |
| 636 std::string(chrome::kBrowserProcessExecutableName) + "-" + url.spec(); | 636 std::string(chrome::kBrowserProcessExecutableName) + "-" + url.spec(); |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 942 for (std::vector<base::FilePath>::const_iterator it = | 942 for (std::vector<base::FilePath>::const_iterator it = |
| 943 shortcut_filenames_app_menu.begin(); | 943 shortcut_filenames_app_menu.begin(); |
| 944 it != shortcut_filenames_app_menu.end(); ++it) { | 944 it != shortcut_filenames_app_menu.end(); ++it) { |
| 945 DeleteShortcutInApplicationsMenu(*it, | 945 DeleteShortcutInApplicationsMenu(*it, |
| 946 base::FilePath(kDirectoryFilename)); | 946 base::FilePath(kDirectoryFilename)); |
| 947 } | 947 } |
| 948 } | 948 } |
| 949 } | 949 } |
| 950 | 950 |
| 951 } // namespace ShellIntegrationLinux | 951 } // namespace ShellIntegrationLinux |
| OLD | NEW |