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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 121 |
122 DISALLOW_COPY_AND_ASSIGN(UserSpecificRegistrySuffix); | 122 DISALLOW_COPY_AND_ASSIGN(UserSpecificRegistrySuffix); |
123 }; // class UserSpecificRegistrySuffix | 123 }; // class UserSpecificRegistrySuffix |
124 | 124 |
125 UserSpecificRegistrySuffix::UserSpecificRegistrySuffix() { | 125 UserSpecificRegistrySuffix::UserSpecificRegistrySuffix() { |
126 base::string16 user_sid; | 126 base::string16 user_sid; |
127 if (!base::win::GetUserSidString(&user_sid)) { | 127 if (!base::win::GetUserSidString(&user_sid)) { |
128 NOTREACHED(); | 128 NOTREACHED(); |
129 return; | 129 return; |
130 } | 130 } |
131 COMPILE_ASSERT(sizeof(base::MD5Digest) == 16, size_of_MD5_not_as_expected_); | 131 static_assert(sizeof(base::MD5Digest) == 16, "size of MD5 not as expected"); |
132 base::MD5Digest md5_digest; | 132 base::MD5Digest md5_digest; |
133 std::string user_sid_ascii(base::UTF16ToASCII(user_sid)); | 133 std::string user_sid_ascii(base::UTF16ToASCII(user_sid)); |
134 base::MD5Sum(user_sid_ascii.c_str(), user_sid_ascii.length(), &md5_digest); | 134 base::MD5Sum(user_sid_ascii.c_str(), user_sid_ascii.length(), &md5_digest); |
135 const base::string16 base32_md5( | 135 const base::string16 base32_md5( |
136 ShellUtil::ByteArrayToBase32(md5_digest.a, arraysize(md5_digest.a))); | 136 ShellUtil::ByteArrayToBase32(md5_digest.a, arraysize(md5_digest.a))); |
137 // The value returned by the base32 algorithm above must never change and | 137 // The value returned by the base32 algorithm above must never change and |
138 // must always be 26 characters long (i.e. if someone ever moves this to | 138 // must always be 26 characters long (i.e. if someone ever moves this to |
139 // base and implements the full base32 algorithm (i.e. with appended '=' | 139 // base and implements the full base32 algorithm (i.e. with appended '=' |
140 // signs in the output), they must provide a flag to allow this method to | 140 // signs in the output), they must provide a flag to allow this method to |
141 // still request the output with no appended '=' signs). | 141 // still request the output with no appended '=' signs). |
(...skipping 2404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2546 base::string16 key_path(kRegClasses); | 2546 base::string16 key_path(kRegClasses); |
2547 key_path.push_back(base::FilePath::kSeparators[0]); | 2547 key_path.push_back(base::FilePath::kSeparators[0]); |
2548 key_path.append(prog_id); | 2548 key_path.append(prog_id); |
2549 return InstallUtil::DeleteRegistryKey( | 2549 return InstallUtil::DeleteRegistryKey( |
2550 HKEY_CURRENT_USER, key_path, WorkItem::kWow64Default); | 2550 HKEY_CURRENT_USER, key_path, WorkItem::kWow64Default); |
2551 | 2551 |
2552 // TODO(mgiuca): Remove the extension association entries. This requires that | 2552 // TODO(mgiuca): Remove the extension association entries. This requires that |
2553 // the extensions associated with a particular prog_id are stored in that | 2553 // the extensions associated with a particular prog_id are stored in that |
2554 // prog_id's key. | 2554 // prog_id's key. |
2555 } | 2555 } |
OLD | NEW |