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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/shell_integration_win.h" 5 #include "chrome/browser/shell_integration_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <shlwapi.h> 8 #include <shlwapi.h>
9 #include <shobjidl.h> 9 #include <shobjidl.h>
10 #include <propkey.h> // Needs to come after shobjidl.h. 10 #include <propkey.h> // Needs to come after shobjidl.h.
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 if (!ShellUtil::ShowMakeChromeDefaultProtocolClientSystemUI(dist, chrome_exe, 682 if (!ShellUtil::ShowMakeChromeDefaultProtocolClientSystemUI(dist, chrome_exe,
683 wprotocol)) { 683 wprotocol)) {
684 LOG(ERROR) << "Failed to launch the set-default-client Windows UI."; 684 LOG(ERROR) << "Failed to launch the set-default-client Windows UI.";
685 return false; 685 return false;
686 } 686 }
687 687
688 VLOG(1) << "Set-default-client Windows UI completed."; 688 VLOG(1) << "Set-default-client Windows UI completed.";
689 return true; 689 return true;
690 } 690 }
691 691
692 void SetAsDefaultProtocolClientUsingSystemSettings(
693 const std::string& protocol,
694 const base::Closure& on_finished_callback) {
695 DCHECK_CURRENTLY_ON(BrowserThread::FILE);
696
697 base::FilePath chrome_exe;
698 if (!PathService::Get(base::FILE_EXE, &chrome_exe)) {
699 NOTREACHED() << "Error getting app exe path";
700 on_finished_callback.Run();
701 return;
702 }
703
704 // The helper manages its own lifetime.
705 base::string16 wprotocol(base::UTF8ToUTF16(protocol));
706 static const wchar_t* const kProtocols[] = {wprotocol.c_str(), nullptr};
707 OpenSystemSettingsHelper::Begin(kProtocols, on_finished_callback);
708
709 BrowserDistribution* dist = BrowserDistribution::GetDistribution();
710 ShellUtil::ShowMakeChromeDefaultProtocolClientSystemUI(dist, chrome_exe,
711 wprotocol);
712 }
713
692 } // namespace win 714 } // namespace win
693 715
694 } // namespace shell_integration 716 } // namespace shell_integration
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698