Index: chrome/browser/ui/views/app_list/app_list_controller_win.cc |
diff --git a/chrome/browser/ui/views/app_list/app_list_controller_win.cc b/chrome/browser/ui/views/app_list/app_list_controller_win.cc |
index 5ec2fdd62a13ad4645914a95dbd9420f40771963..bdab8eadbc8ae58d6e4c764547545a7a2e04c7aa 100644 |
--- a/chrome/browser/ui/views/app_list/app_list_controller_win.cc |
+++ b/chrome/browser/ui/views/app_list/app_list_controller_win.cc |
@@ -43,6 +43,7 @@ |
#include "chrome/installer/launcher_support/chrome_launcher_support.h" |
#include "chrome/installer/util/browser_distribution.h" |
#include "chrome/installer/util/google_update_settings.h" |
+#include "chrome/installer/util/install_util.h" |
#include "chrome/installer/util/util_constants.h" |
#include "content/public/browser/browser_thread.h" |
#include "grit/chromium_strings.h" |
@@ -60,10 +61,6 @@ |
#include "ui/views/widget/widget.h" |
#include "win8/util/win8_util.h" |
-#if defined(GOOGLE_CHROME_BUILD) |
-#include "chrome/installer/util/install_util.h" |
-#endif |
- |
#if defined(USE_AURA) |
#include "ui/aura/root_window.h" |
#include "ui/aura/window.h" |
@@ -157,24 +154,22 @@ void CreateAppListShortcuts( |
const ShellIntegration::ShortcutLocations& creation_locations) { |
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); |
+ base::FilePath chrome_exe; |
+ if (!PathService::Get(base::FILE_EXE, &chrome_exe)) { |
+ NOTREACHED(); |
+ } |
+ ShellUtil::ShellChange install_level = |
+ InstallUtil::IsPerUserInstall(chrome_exe.value().c_str()) ? |
+ ShellUtil::CURRENT_USER : ShellUtil::SYSTEM_LEVEL; |
gab
2013/04/26 15:21:03
Actually, if this is called by Chrome running as t
calamity
2013/04/29 07:20:05
Done.
Thanks for explaining this.
|
+ |
// Shortcut paths under which to create shortcuts. |
std::vector<base::FilePath> shortcut_paths = |
- web_app::internals::GetShortcutPaths(creation_locations); |
+ web_app::internals::GetShortcutPaths(creation_locations, |
+ install_level); |
bool pin_to_taskbar = creation_locations.in_quick_launch_bar && |
(base::win::GetVersion() >= base::win::VERSION_WIN7); |
- // Create a shortcut in the |user_data_dir| for taskbar pinning. |
- if (pin_to_taskbar) |
- shortcut_paths.push_back(user_data_dir); |
- bool success = true; |
- |
- base::FilePath chrome_exe; |
- if (!PathService::Get(base::FILE_EXE, &chrome_exe)) { |
- NOTREACHED(); |
- return; |
- } |
- |
string16 wide_switches(GetAppListCommandLine().GetArgumentsString()); |
base::win::ShortcutProperties shortcut_properties; |
@@ -195,18 +190,21 @@ void CreateAppListShortcuts( |
if (!file_util::PathExists(shortcut_file.DirName()) && |
!file_util::CreateDirectory(shortcut_file.DirName())) { |
NOTREACHED(); |
- return; |
+ continue; |
} |
- success = success && base::win::CreateOrUpdateShortcutLink( |
- shortcut_file, shortcut_properties, |
- base::win::SHORTCUT_CREATE_ALWAYS); |
+ base::win::CreateOrUpdateShortcutLink(shortcut_file, |
+ shortcut_properties, |
+ base::win::SHORTCUT_CREATE_ALWAYS); |
} |
- if (success && pin_to_taskbar) { |
- base::FilePath shortcut_to_pin = user_data_dir.Append(file_name). |
- AddExtension(installer::kLnkExt); |
- success = base::win::TaskbarPinShortcutLink( |
- shortcut_to_pin.value().c_str()) && success; |
+ // Create a shortcut in the |user_data_dir| for taskbar pinning. |
+ if (pin_to_taskbar) { |
+ base::FilePath shortcut_file = user_data_dir.Append(file_name). |
+ AddExtension(installer::kLnkExt); |
+ base::win::CreateOrUpdateShortcutLink(shortcut_file, |
+ shortcut_properties, |
+ base::win::SHORTCUT_CREATE_ALWAYS); |
+ base::win::TaskbarPinShortcutLink(shortcut_file.value().c_str()); |
gab
2013/04/26 15:21:03
Only pin if the creation above was successful.
calamity
2013/04/29 07:20:05
Done.
|
} |
} |
@@ -974,8 +972,6 @@ void AppListController::EnableAppList() { |
shortcut_locations.on_desktop = true; |
shortcut_locations.in_quick_launch_bar = true; |
shortcut_locations.in_applications_menu = true; |
- shortcut_locations.applications_menu_subdir = |
- l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); |
base::FilePath user_data_dir( |
g_browser_process->profile_manager()->user_data_dir()); |