| 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 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1123 // to avoid losing the unique parts of this component (which are usually | 1123 // to avoid losing the unique parts of this component (which are usually |
| 1124 // at the beginning or end for things like usernames and paths). | 1124 // at the beginning or end for things like usernames and paths). |
| 1125 app_id.append(component.c_str(), 0, max_component_length / 2); | 1125 app_id.append(component.c_str(), 0, max_component_length / 2); |
| 1126 app_id.append(component.c_str(), | 1126 app_id.append(component.c_str(), |
| 1127 component.length() - ((max_component_length + 1) / 2), | 1127 component.length() - ((max_component_length + 1) / 2), |
| 1128 string16::npos); | 1128 string16::npos); |
| 1129 } else { | 1129 } else { |
| 1130 app_id.append(component); | 1130 app_id.append(component); |
| 1131 } | 1131 } |
| 1132 } | 1132 } |
| 1133 // No spaces are allowed in the AppUserModelId according to MSDN. |
| 1134 ReplaceChars(app_id, L" ", L"_", &app_id); |
| 1133 return app_id; | 1135 return app_id; |
| 1134 } | 1136 } |
| 1135 | 1137 |
| 1136 // static | 1138 // static |
| 1137 bool ShellUtil::CanMakeChromeDefaultUnattended() { | 1139 bool ShellUtil::CanMakeChromeDefaultUnattended() { |
| 1138 return base::win::GetVersion() < base::win::VERSION_WIN8; | 1140 return base::win::GetVersion() < base::win::VERSION_WIN8; |
| 1139 } | 1141 } |
| 1140 | 1142 |
| 1141 bool ShellUtil::MakeChromeDefault(BrowserDistribution* dist, | 1143 bool ShellUtil::MakeChromeDefault(BrowserDistribution* dist, |
| 1142 int shell_change, | 1144 int shell_change, |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1511 chrome_exe.c_str(), | 1513 chrome_exe.c_str(), |
| 1512 shortcut.c_str(), | 1514 shortcut.c_str(), |
| 1513 chrome_path.value().c_str(), | 1515 chrome_path.value().c_str(), |
| 1514 arguments.c_str(), | 1516 arguments.c_str(), |
| 1515 description.c_str(), | 1517 description.c_str(), |
| 1516 icon_path.c_str(), | 1518 icon_path.c_str(), |
| 1517 icon_index, | 1519 icon_index, |
| 1518 app_id.c_str(), | 1520 app_id.c_str(), |
| 1519 ConvertShellUtilShortcutOptionsToFileUtil(options)); | 1521 ConvertShellUtilShortcutOptionsToFileUtil(options)); |
| 1520 } | 1522 } |
| OLD | NEW |