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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 const string16& chrome_exe, | 82 const string16& chrome_exe, |
83 const string16& suffix, | 83 const string16& suffix, |
84 std::list<RegistryEntry*>* entries) { | 84 std::list<RegistryEntry*>* entries) { |
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 bool set_delegate_execute = | 92 bool set_delegate_execute = |
gab
2012/04/25 05:18:29
Do we want to also check && dist->CanSetAsDefault(
grt (UTC plus 2)
2012/04/25 13:05:11
This function is never called when !dist->CanSetAs
gab
2012/04/25 13:44:02
Ah ok right. A DCHECK wouldn't hurt, but to be con
grt (UTC plus 2)
2012/04/25 14:33:49
Groovy.
| |
93 base::win::GetVersion() >= base::win::VERSION_WIN8 && | 93 dist->GetDelegateExecuteHandlerData(&delegate_guid, NULL, NULL, NULL) && |
94 dist->GetDelegateExecuteHandlerData(&delegate_guid, NULL, NULL, NULL); | 94 InstallUtil::HasDelegateExecuteHandler(dist, chrome_exe); |
gab
2012/04/25 05:18:29
This is somewhat cleaner than the registry lookup
grt (UTC plus 2)
2012/04/25 13:05:11
I think it's safer for all logic to key off the sa
gab
2012/04/25 13:44:02
But in this case your code checking for A deletes
grt (UTC plus 2)
2012/04/25 14:33:49
Except when it doesn't. Rather than mathematicall
| |
95 | 95 |
96 // DelegateExecute ProgId. Needed for Chrome Metro in Windows 8. | 96 // DelegateExecute ProgId. Needed for Chrome Metro in Windows 8. |
97 if (set_delegate_execute) { | 97 if (set_delegate_execute) { |
gab
2012/04/25 13:44:02
FYI, this code still will not remove
\\Software\Cl
grt (UTC plus 2)
2012/04/25 14:33:49
Indeed. I've added this to a more recent patchset
| |
98 string16 model_id_shell(ShellUtil::kRegClasses); | 98 string16 model_id_shell(ShellUtil::kRegClasses); |
99 model_id_shell.push_back(FilePath::kSeparators[0]); | 99 model_id_shell.push_back(FilePath::kSeparators[0]); |
100 model_id_shell.append(app_id); | 100 model_id_shell.append(app_id); |
101 model_id_shell.append(ShellUtil::kRegExePath); | 101 model_id_shell.append(ShellUtil::kRegExePath); |
102 model_id_shell.append(ShellUtil::kRegShellPath); | 102 model_id_shell.append(ShellUtil::kRegShellPath); |
103 | 103 |
104 // <root hkey>\Software\Classes\<app_id>\.exe\shell @=open | 104 // <root hkey>\Software\Classes\<app_id>\.exe\shell @=open |
105 entries->push_front(new RegistryEntry(model_id_shell, | 105 entries->push_front(new RegistryEntry(model_id_shell, |
106 ShellUtil::kRegVerbOpen)); | 106 ShellUtil::kRegVerbOpen)); |
107 | 107 |
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1215 chrome_exe.c_str(), | 1215 chrome_exe.c_str(), |
1216 shortcut.c_str(), | 1216 shortcut.c_str(), |
1217 chrome_path.c_str(), | 1217 chrome_path.c_str(), |
1218 arguments.c_str(), | 1218 arguments.c_str(), |
1219 description.c_str(), | 1219 description.c_str(), |
1220 icon_path.c_str(), | 1220 icon_path.c_str(), |
1221 icon_index, | 1221 icon_index, |
1222 dist->GetBrowserAppId().c_str(), | 1222 dist->GetBrowserAppId().c_str(), |
1223 ConvertShellUtilShortcutOptionsToFileUtil(options)); | 1223 ConvertShellUtilShortcutOptionsToFileUtil(options)); |
1224 } | 1224 } |
OLD | NEW |