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

Unified Diff: chrome/browser/shell_integration_win.cc

Issue 1896513002: Fix registerProtocolHandler implementation on Windows 8 and 10. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 9a92a9c438eacc3dd186c19701c4a74d41639d37..46a4055c04823a570c00aac2222567ede886190c 100644
--- a/chrome/browser/shell_integration_win.cc
+++ b/chrome/browser/shell_integration_win.cc
@@ -689,6 +689,28 @@ bool SetAsDefaultProtocolClientUsingIntentPicker(const std::string& protocol) {
return true;
}
+void SetAsDefaultProtocolClientUsingSystemSettings(
+ const std::string& protocol,
+ const base::Closure& on_finished_callback) {
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
+
+ base::FilePath chrome_exe;
+ if (!PathService::Get(base::FILE_EXE, &chrome_exe)) {
+ NOTREACHED() << "Error getting app exe path";
+ on_finished_callback.Run();
+ return;
+ }
+
+ // The helper manages its own lifetime.
+ base::string16 wprotocol(base::UTF8ToUTF16(protocol));
+ static const wchar_t* const kProtocols[] = {wprotocol.c_str(), nullptr};
+ OpenSystemSettingsHelper::Begin(kProtocols, on_finished_callback);
+
+ BrowserDistribution* dist = BrowserDistribution::GetDistribution();
+ ShellUtil::ShowMakeChromeDefaultProtocolClientSystemUI(dist, chrome_exe,
+ wprotocol);
+}
+
} // namespace win
} // namespace shell_integration

Powered by Google App Engine
This is Rietveld 408576698