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

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

Issue 1289333005: Change shortcut install location to non-subdir. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert part of cl/1438793002 that is no longer needed Created 5 years, 1 month 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.h" 5 #include "chrome/browser/shell_integration.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 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 size_t folder = InstallUtil::IsPerUserInstall(chrome_exe) ? 1 : 0; 617 size_t folder = InstallUtil::IsPerUserInstall(chrome_exe) ? 1 : 0;
618 for (; folder < arraysize(kFolderIds); ++folder) { 618 for (; folder < arraysize(kFolderIds); ++folder) {
619 if (!PathService::Get(kFolderIds[folder], &programs_folder)) { 619 if (!PathService::Get(kFolderIds[folder], &programs_folder)) {
620 NOTREACHED(); 620 NOTREACHED();
621 continue; 621 continue;
622 } 622 }
623 623
624 shortcut = programs_folder.Append(shortcut_name); 624 shortcut = programs_folder.Append(shortcut_name);
625 if (base::PathExists(shortcut)) 625 if (base::PathExists(shortcut))
626 return shortcut; 626 return shortcut;
627
628 // Check in "Start Menu\Programs\<BROWSER>" if the shortcut was not found in
629 // "Start Menu\Programs". This fallback check is here to handle running
630 // instances that are updated past the change that migrates Chrome's start
631 // menu shortcut from the "Google Chrome" folder up into the main "Programs"
632 // folder. This code will become obsolete when the migration change lands,
633 // and is to be removed in that change.
634 shortcut =
635 programs_folder.Append(dist->GetStartMenuShortcutSubfolder(
636 BrowserDistribution::SUBFOLDER_CHROME))
637 .Append(shortcut_name);
638 if (base::PathExists(shortcut))
639 return shortcut;
640 } 627 }
641 628
642 return base::FilePath(); 629 return base::FilePath();
643 } 630 }
644 631
645 // static 632 // static
646 bool ShellIntegration::DefaultWebClientWorker::ShouldReportAttemptResults() { 633 bool ShellIntegration::DefaultWebClientWorker::ShouldReportAttemptResults() {
647 return base::win::GetVersion() >= base::win::VERSION_WIN10 && 634 return base::win::GetVersion() >= base::win::VERSION_WIN10 &&
648 IsSetAsDefaultAsynchronous(); 635 IsSetAsDefaultAsynchronous();
649 } 636 }
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 // in the "How would you like to open this?" prompt. 691 // in the "How would you like to open this?" prompt.
705 if (!RegisterBrowser()) 692 if (!RegisterBrowser())
706 return false; 693 return false;
707 694
708 ResetDefaultBrowser(); 695 ResetDefaultBrowser();
709 696
710 base::CommandLine cmdline(base::FilePath(L"openwith.exe")); 697 base::CommandLine cmdline(base::FilePath(L"openwith.exe"));
711 cmdline.AppendArgNative(StartupBrowserCreator::GetDefaultBrowserUrl()); 698 cmdline.AppendArgNative(StartupBrowserCreator::GetDefaultBrowserUrl());
712 return base::LaunchProcess(cmdline, base::LaunchOptions()).IsValid(); 699 return base::LaunchProcess(cmdline, base::LaunchOptions()).IsValid();
713 } 700 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_main_win.cc ('k') | chrome/browser/ui/views/app_list/win/app_list_service_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698