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

Unified Diff: chrome/browser/shell_integration_linux.cc

Issue 214010: More reliably find the .desktop file for the browser. (Closed)
Patch Set: Created 11 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698