Skip to content

Commit

Permalink
Temporary solution for solving conflict between RegisterProtocolHandler
Browse files Browse the repository at this point in the history
and Set Default Browser

fix brave/browser-laptop#5028

Auditors: @bbondy, @bridiver
  • Loading branch information
darkdh committed Oct 21, 2016
1 parent d910be2 commit 8d6a6ed
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions atom/browser/browser_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,9 @@ bool Browser::SetAsDefaultProtocolClient(const std::string& protocol,
if (protocol.empty())
return false;

if (base::win::GetVersion() >= base::win::VERSION_WIN8)
// TODO(Anthony): refactoring set default browser and set default protocol
// client as separated APIs
if (base::win::GetVersion() >= base::win::VERSION_WIN8 && protocol == "http")
return LaunchDefaultAppsSettingsModernDialog(
base::UTF8ToUTF16(protocol).c_str());

Expand Down Expand Up @@ -304,7 +306,10 @@ bool Browser::IsDefaultProtocolClient(const std::string& protocol,
// value not set, we can confirm that it is not set
return false;

if (base::win::GetVersion() >= base::win::VERSION_WIN8)
// TODO(Anthony): refactoring is default browser and is default protocol
// client as separated APIs
if (base::win::GetVersion() >= base::win::VERSION_WIN8 &&
(protocol == "http" || protocol == "https"))
return choiceVal == prog;

base::string16 exe;
Expand Down

0 comments on commit 8d6a6ed

Please sign in to comment.