Chromium Code Reviews| Index: chrome/browser/shell_integration_linux.cc |
| diff --git a/chrome/browser/shell_integration_linux.cc b/chrome/browser/shell_integration_linux.cc |
| index 1c3fad22057e1d740d579755e7ec40338601142a..78c84433fe24e9427fa7db6fb1673238b8b68f0a 100644 |
| --- a/chrome/browser/shell_integration_linux.cc |
| +++ b/chrome/browser/shell_integration_linux.cc |
| @@ -77,25 +77,27 @@ bool LaunchXdgUtility(const std::vector<std::string>& argv) { |
| } |
| bool GetDesktopShortcutTemplate(std::string* output) { |
| - std::vector<std::string> search_paths; |
| + std::vector<FilePath> search_paths; |
| const char* xdg_data_home = getenv("XDG_DATA_HOME"); |
| if (xdg_data_home) |
| - search_paths.push_back(xdg_data_home); |
| + search_paths.push_back(FilePath(xdg_data_home)); |
| const char* xdg_data_dirs = getenv("XDG_DATA_DIRS"); |
| if (xdg_data_dirs) { |
| CStringTokenizer tokenizer(xdg_data_dirs, |
| xdg_data_dirs + strlen(xdg_data_dirs), ":"); |
| while (tokenizer.GetNext()) { |
| - search_paths.push_back(tokenizer.token()); |
| + FilePath data_dir(tokenizer.token()); |
| + search_paths.push_back(data_dir); |
| + search_paths.push_back(data_dir.Append("applications")); |
|
Mike Mammarella
2009/09/17 17:23:53
Technically the string constant should be wrapped
|
| } |
| } |
| std::string template_filename(GetDesktopName()); |
| - for (std::vector<std::string>::const_iterator i = search_paths.begin(); |
| + for (std::vector<FilePath>::const_iterator i = search_paths.begin(); |
| i != search_paths.end(); ++i) { |
| - FilePath path = FilePath(*i).Append(template_filename); |
| + FilePath path = (*i).Append(template_filename); |
| if (file_util::PathExists(path)) |
| return file_util::ReadFileToString(path, output); |
| } |