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

Side by Side Diff: chrome/browser/shell_integration_win.cc

Issue 2172573002: [win] Fallback to registry when finding external handlers for a protocol (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweaked Created 4 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 // Windows 8 and 10 both introduced a new way to set the default web client 514 // Windows 8 and 10 both introduced a new way to set the default web client
515 // which require user interaction. 515 // which require user interaction.
516 return SET_DEFAULT_INTERACTIVE; 516 return SET_DEFAULT_INTERACTIVE;
517 } 517 }
518 518
519 bool IsElevationNeededForSettingDefaultProtocolClient() { 519 bool IsElevationNeededForSettingDefaultProtocolClient() {
520 return base::win::GetVersion() < base::win::VERSION_WIN8; 520 return base::win::GetVersion() < base::win::VERSION_WIN8;
521 } 521 }
522 522
523 base::string16 GetApplicationNameForProtocol(const GURL& url) { 523 base::string16 GetApplicationNameForProtocol(const GURL& url) {
524 // Windows 8 or above requires a new protocol association query. 524 base::string16 application_name;
525 if (base::win::GetVersion() >= base::win::VERSION_WIN8) 525 // Windows 8 or above has a new protocol association query.
526 return GetAppForProtocolUsingAssocQuery(url); 526 if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
527 else 527 application_name = GetAppForProtocolUsingAssocQuery(url);
528 return GetAppForProtocolUsingRegistry(url); 528 if (!application_name.empty())
529 return application_name;
530 }
531
532 return GetAppForProtocolUsingRegistry(url);
529 } 533 }
530 534
531 DefaultWebClientState GetDefaultBrowser() { 535 DefaultWebClientState GetDefaultBrowser() {
532 return GetDefaultWebClientStateFromShellUtilDefaultState( 536 return GetDefaultWebClientStateFromShellUtilDefaultState(
533 ShellUtil::GetChromeDefaultState()); 537 ShellUtil::GetChromeDefaultState());
534 } 538 }
535 539
536 // There is no reliable way to say which browser is default on a machine (each 540 // There is no reliable way to say which browser is default on a machine (each
537 // browser can have some of the protocols/shortcuts). So we look for only HTTP 541 // browser can have some of the protocols/shortcuts). So we look for only HTTP
538 // protocol handler. Even this handler is located at different places in 542 // protocol handler. Even this handler is located at different places in
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 if (base::PathExists(shortcut)) 853 if (base::PathExists(shortcut))
850 return shortcut; 854 return shortcut;
851 } 855 }
852 856
853 return base::FilePath(); 857 return base::FilePath();
854 } 858 }
855 859
856 } // namespace win 860 } // namespace win
857 861
858 } // namespace shell_integration 862 } // namespace shell_integration
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698