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

Unified Diff: chrome/browser/shell_integration_win.cc

Issue 2076253002: Simplify the text in the external protocol confirmation dialog. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix ChromeOS compile Created 4 years, 2 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
Index: chrome/browser/shell_integration_win.cc
diff --git a/chrome/browser/shell_integration_win.cc b/chrome/browser/shell_integration_win.cc
index 34c5e265f42fa19d1bc9cb9c7dd1861d9bcb6f55..37dd3c0bdad28b16ebeca725a8d851ab960fa55f 100644
--- a/chrome/browser/shell_integration_win.cc
+++ b/chrome/browser/shell_integration_win.cc
@@ -205,15 +205,13 @@ base::string16 GetAppForProtocolUsingRegistry(const GURL& url) {
base::win::RegKey cmd_key(HKEY_CLASSES_ROOT,
cmd_key_path.c_str(),
KEY_READ);
- base::string16 application_to_launch;
- if (cmd_key.ReadValue(NULL, &application_to_launch) == ERROR_SUCCESS) {
- const base::string16 url_spec =
- base::ASCIIToUTF16(url.possibly_invalid_spec());
- base::ReplaceSubstringsAfterOffset(&application_to_launch,
- 0,
- L"%1",
- url_spec);
- return application_to_launch;
+ base::string16 command_to_launch;
+ if (cmd_key.ReadValue(NULL, &command_to_launch) == ERROR_SUCCESS) {
+ // Parse the command line in the registry, and return the basename of the
+ // program path.
+ base::CommandLine command_line(
+ base::CommandLine::FromString(command_to_launch));
+ return base::WideToUTF16(command_line.GetProgram().BaseName().value());
}
return base::string16();
}

Powered by Google App Engine
This is Rietveld 408576698