OLD | NEW |
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 // This file defines functions that integrate Chrome in Windows shell. These | 5 // This file defines functions that integrate Chrome in Windows shell. These |
6 // functions can be used by Chrome as well as Chrome installer. All of the | 6 // functions can be used by Chrome as well as Chrome installer. All of the |
7 // work is done by the local functions defined in anonymous namespace in | 7 // work is done by the local functions defined in anonymous namespace in |
8 // this class. | 8 // this class. |
9 | 9 |
10 #include "chrome/installer/util/shell_util.h" | 10 #include "chrome/installer/util/shell_util.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 string16 icon_path(ShellUtil::GetChromeIcon(dist, chrome_exe)); | 85 string16 icon_path(ShellUtil::GetChromeIcon(dist, chrome_exe)); |
86 string16 open_cmd(ShellUtil::GetChromeShellOpenCmd(chrome_exe)); | 86 string16 open_cmd(ShellUtil::GetChromeShellOpenCmd(chrome_exe)); |
87 string16 delegate_command(ShellUtil::GetChromeDelegateCommand(chrome_exe)); | 87 string16 delegate_command(ShellUtil::GetChromeDelegateCommand(chrome_exe)); |
88 // For user-level installs: entries for the app id and DelegateExecute verb | 88 // For user-level installs: entries for the app id and DelegateExecute verb |
89 // handler will be in HKCU; thus we do not need a suffix on those entries. | 89 // handler will be in HKCU; thus we do not need a suffix on those entries. |
90 string16 app_id(dist->GetBrowserAppId()); | 90 string16 app_id(dist->GetBrowserAppId()); |
91 string16 delegate_guid; | 91 string16 delegate_guid; |
92 // TODO(grt): remove HasDelegateExecuteHandler when the exe is ever-present; | 92 // TODO(grt): remove HasDelegateExecuteHandler when the exe is ever-present; |
93 // see also install_worker.cc's AddDelegateExecuteWorkItems. | 93 // see also install_worker.cc's AddDelegateExecuteWorkItems. |
94 bool set_delegate_execute = | 94 bool set_delegate_execute = |
| 95 base::win::GetVersion() >= base::win::VERSION_WIN8 && |
95 dist->GetDelegateExecuteHandlerData(&delegate_guid, NULL, NULL, NULL) && | 96 dist->GetDelegateExecuteHandlerData(&delegate_guid, NULL, NULL, NULL) && |
96 InstallUtil::HasDelegateExecuteHandler(dist, chrome_exe); | 97 InstallUtil::HasDelegateExecuteHandler(dist, chrome_exe); |
97 | 98 |
98 // DelegateExecute ProgId. Needed for Chrome Metro in Windows 8. | 99 // DelegateExecute ProgId. Needed for Chrome Metro in Windows 8. |
99 if (set_delegate_execute) { | 100 if (set_delegate_execute) { |
100 string16 model_id_shell(ShellUtil::kRegClasses); | 101 string16 model_id_shell(ShellUtil::kRegClasses); |
101 model_id_shell.push_back(FilePath::kSeparators[0]); | 102 model_id_shell.push_back(FilePath::kSeparators[0]); |
102 model_id_shell.append(app_id); | 103 model_id_shell.append(app_id); |
103 model_id_shell.append(ShellUtil::kRegExePath); | 104 model_id_shell.append(ShellUtil::kRegExePath); |
104 model_id_shell.append(ShellUtil::kRegShellPath); | 105 model_id_shell.append(ShellUtil::kRegShellPath); |
(...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1260 chrome_exe.c_str(), | 1261 chrome_exe.c_str(), |
1261 shortcut.c_str(), | 1262 shortcut.c_str(), |
1262 chrome_path.c_str(), | 1263 chrome_path.c_str(), |
1263 arguments.c_str(), | 1264 arguments.c_str(), |
1264 description.c_str(), | 1265 description.c_str(), |
1265 icon_path.c_str(), | 1266 icon_path.c_str(), |
1266 icon_index, | 1267 icon_index, |
1267 dist->GetBrowserAppId().c_str(), | 1268 dist->GetBrowserAppId().c_str(), |
1268 ConvertShellUtilShortcutOptionsToFileUtil(options)); | 1269 ConvertShellUtilShortcutOptionsToFileUtil(options)); |
1269 } | 1270 } |
OLD | NEW |