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

Unified Diff: chrome/browser/shell_integration.cc

Issue 1896513002: Fix registerProtocolHandler implementation on Windows 8 and 10. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Round of comment #1 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.cc
diff --git a/chrome/browser/shell_integration.cc b/chrome/browser/shell_integration.cc
index ca8157b6cf415eed6dd845d89fedbbc273b51f16..d9af4f0e615600943e7dfc0950eaace8f55909f7 100644
--- a/chrome/browser/shell_integration.cc
+++ b/chrome/browser/shell_integration.cc
@@ -27,6 +27,7 @@
#if defined(OS_WIN)
#include "base/win/windows_version.h"
#include "chrome/browser/shell_integration_win.h"
+#include "chrome/installer/util/shell_util.h"
#endif
#if !defined(OS_WIN)
@@ -244,13 +245,15 @@ void DefaultBrowserWorker::SetAsDefaultImpl(
case SET_DEFAULT_INTERACTIVE:
#if defined(OS_WIN)
if (interactive_permitted_) {
- // The Windows 8 API for choosing the default browser was deprecated on
- // Windows 10.
- if (base::win::GetVersion() >= base::win::VERSION_WIN10) {
- win::SetAsDefaultBrowserUsingSystemSettings(on_finished_callback);
- return;
- } else {
- win::SetAsDefaultBrowserUsingIntentPicker();
+ switch (ShellUtil::GetInteractiveSetDefaultMode()) {
+ case ShellUtil::INTENT_PICKER:
+ win::SetAsDefaultBrowserUsingIntentPicker();
+ break;
+ case ShellUtil::SYSTEM_SETTINGS:
+ win::SetAsDefaultBrowserUsingSystemSettings(on_finished_callback);
+ // Early return because the function above takes care of calling
+ // |on_finished_callback|.
+ return;
}
}
#endif // defined(OS_WIN)
@@ -292,9 +295,19 @@ void DefaultProtocolClientWorker::SetAsDefaultImpl(
break;
case SET_DEFAULT_INTERACTIVE:
#if defined(OS_WIN)
- // TODO(pmonette): Implement a working flow for Windows 10.
- if (interactive_permitted_)
- win::SetAsDefaultProtocolClientUsingIntentPicker(protocol_);
+ if (interactive_permitted_) {
+ switch (ShellUtil::GetInteractiveSetDefaultMode()) {
+ case ShellUtil::INTENT_PICKER:
+ win::SetAsDefaultProtocolClientUsingIntentPicker(protocol_);
+ break;
+ case ShellUtil::SYSTEM_SETTINGS:
+ win::SetAsDefaultProtocolClientUsingSystemSettings(
+ protocol_, on_finished_callback);
+ // Early return because the function above takes care of calling
+ // |on_finished_callback|.
+ return;
+ }
+ }
#endif // defined(OS_WIN)
break;
}

Powered by Google App Engine
This is Rietveld 408576698