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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 144 |
145 DISALLOW_COPY_AND_ASSIGN(UserSpecificRegistrySuffix); | 145 DISALLOW_COPY_AND_ASSIGN(UserSpecificRegistrySuffix); |
146 }; // class UserSpecificRegistrySuffix | 146 }; // class UserSpecificRegistrySuffix |
147 | 147 |
148 UserSpecificRegistrySuffix::UserSpecificRegistrySuffix() { | 148 UserSpecificRegistrySuffix::UserSpecificRegistrySuffix() { |
149 base::string16 user_sid; | 149 base::string16 user_sid; |
150 if (!base::win::GetUserSidString(&user_sid)) { | 150 if (!base::win::GetUserSidString(&user_sid)) { |
151 NOTREACHED(); | 151 NOTREACHED(); |
152 return; | 152 return; |
153 } | 153 } |
154 COMPILE_ASSERT(sizeof(base::MD5Digest) == 16, size_of_MD5_not_as_expected_); | 154 static_assert(sizeof(base::MD5Digest) == 16, |
| 155 "size of MD5Digest should be 16"); |
155 base::MD5Digest md5_digest; | 156 base::MD5Digest md5_digest; |
156 std::string user_sid_ascii(base::UTF16ToASCII(user_sid)); | 157 std::string user_sid_ascii(base::UTF16ToASCII(user_sid)); |
157 base::MD5Sum(user_sid_ascii.c_str(), user_sid_ascii.length(), &md5_digest); | 158 base::MD5Sum(user_sid_ascii.c_str(), user_sid_ascii.length(), &md5_digest); |
158 const base::string16 base32_md5( | 159 const base::string16 base32_md5( |
159 ShellUtil::ByteArrayToBase32(md5_digest.a, arraysize(md5_digest.a))); | 160 ShellUtil::ByteArrayToBase32(md5_digest.a, arraysize(md5_digest.a))); |
160 // The value returned by the base32 algorithm above must never change and | 161 // The value returned by the base32 algorithm above must never change and |
161 // must always be 26 characters long (i.e. if someone ever moves this to | 162 // must always be 26 characters long (i.e. if someone ever moves this to |
162 // base and implements the full base32 algorithm (i.e. with appended '=' | 163 // base and implements the full base32 algorithm (i.e. with appended '=' |
163 // signs in the output), they must provide a flag to allow this method to | 164 // signs in the output), they must provide a flag to allow this method to |
164 // still request the output with no appended '=' signs). | 165 // still request the output with no appended '=' signs). |
(...skipping 2304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2469 base::string16 key_path(ShellUtil::kRegClasses); | 2470 base::string16 key_path(ShellUtil::kRegClasses); |
2470 key_path.push_back(base::FilePath::kSeparators[0]); | 2471 key_path.push_back(base::FilePath::kSeparators[0]); |
2471 key_path.append(prog_id); | 2472 key_path.append(prog_id); |
2472 return InstallUtil::DeleteRegistryKey( | 2473 return InstallUtil::DeleteRegistryKey( |
2473 HKEY_CURRENT_USER, key_path, WorkItem::kWow64Default); | 2474 HKEY_CURRENT_USER, key_path, WorkItem::kWow64Default); |
2474 | 2475 |
2475 // TODO(mgiuca): Remove the extension association entries. This requires that | 2476 // TODO(mgiuca): Remove the extension association entries. This requires that |
2476 // the extensions associated with a particular prog_id are stored in that | 2477 // the extensions associated with a particular prog_id are stored in that |
2477 // prog_id's key. | 2478 // prog_id's key. |
2478 } | 2479 } |
OLD | NEW |