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

Unified Diff: chrome/browser/web_applications/web_app_win.cc

Issue 838793004: Windows file associations: Search for shim in Chrome version directory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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/web_applications/web_app_win.cc
diff --git a/chrome/browser/web_applications/web_app_win.cc b/chrome/browser/web_applications/web_app_win.cc
index f9a6d76237c7e557e27147aff5f86ad9fc90a1b2..10bad7198f3101659a5f1bd4bf09e1e40b068141 100644
--- a/chrome/browser/web_applications/web_app_win.cc
+++ b/chrome/browser/web_applications/web_app_win.cc
@@ -393,16 +393,23 @@ void OnShortcutInfoLoadedForSetRelaunchDetails(
// |path| is the full path of the shim binary to be created.
bool CreateAppShimBinary(const base::FilePath& path) {
// TODO(mgiuca): Hard-link instead of copying, if on the same file system.
- base::FilePath chrome_binary_directory;
- if (!PathService::Get(base::DIR_EXE, &chrome_binary_directory)) {
+ // Get the Chrome version directory (the directory containing the chrome.dll
+ // module). This is the directory where app_shim.exe is located.
+ base::FilePath chrome_version_directory;
+ if (!PathService::Get(base::DIR_MODULE, &chrome_version_directory)) {
NOTREACHED();
return false;
}
base::FilePath generic_shim_path =
- chrome_binary_directory.Append(kAppShimExe);
+ chrome_version_directory.Append(kAppShimExe);
if (!base::CopyFile(generic_shim_path, path)) {
- LOG(ERROR) << "Could not copy app shim exe to " << path.value();
+ if (!base::PathExists(generic_shim_path)) {
+ LOG(ERROR) << "Could not find app shim exe at "
+ << generic_shim_path.value();
+ } else {
+ LOG(ERROR) << "Could not copy app shim exe to " << path.value();
+ }
return false;
}
« 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