Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: chrome/installer/util/shell_util.cc

Issue 23581012: Restricting scope of ShellUtil's shortcut update feature for its specific usage in Chrome self-dest… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comment fixes. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 2051 matching lines...) Expand 10 before | Expand all | Expand 10 after
2062 // Remove chrome-specific shortcut folders if they are now empty. 2062 // Remove chrome-specific shortcut folders if they are now empty.
2063 if (success && 2063 if (success &&
2064 (location == SHORTCUT_LOCATION_START_MENU || 2064 (location == SHORTCUT_LOCATION_START_MENU ||
2065 location == SHORTCUT_LOCATION_APP_SHORTCUTS)) { 2065 location == SHORTCUT_LOCATION_APP_SHORTCUTS)) {
2066 success = RemoveShortcutFolderIfEmpty(location, dist, level); 2066 success = RemoveShortcutFolderIfEmpty(location, dist, level);
2067 } 2067 }
2068 return success; 2068 return success;
2069 } 2069 }
2070 2070
2071 // static 2071 // static
2072 bool ShellUtil::UpdateShortcuts( 2072 bool ShellUtil::UpdateShortcutsWithArgs(
2073 ShellUtil::ShortcutLocation location, 2073 ShellUtil::ShortcutLocation location,
2074 BrowserDistribution* dist, 2074 BrowserDistribution* dist,
2075 ShellChange level, 2075 ShellChange level,
2076 const base::FilePath& target_exe, 2076 const base::FilePath& target_exe,
2077 bool require_args,
2078 const ShellUtil::ShortcutProperties& properties) { 2077 const ShellUtil::ShortcutProperties& properties) {
2079 if (!ShellUtil::ShortcutLocationIsSupported(location)) 2078 if (!ShellUtil::ShortcutLocationIsSupported(location))
2080 return true; // Vacuous success. 2079 return true; // Vacuous success.
2081 2080
2082 FilterTargetEq shortcut_filter(target_exe, require_args); 2081 FilterTargetEq shortcut_filter(target_exe, true);
2083 ShortcutOperationCallback shortcut_operation( 2082 ShortcutOperationCallback shortcut_operation(
2084 base::Bind(&ShortcutOpUpdate, TranslateShortcutProperties(properties))); 2083 base::Bind(&ShortcutOpUpdate, TranslateShortcutProperties(properties)));
2085 return BatchShortcutAction(shortcut_filter.AsShortcutFilterCallback(), 2084 return BatchShortcutAction(shortcut_filter.AsShortcutFilterCallback(),
2086 shortcut_operation, location, dist, level); 2085 shortcut_operation, location, dist, level);
2087 } 2086 }
2088 2087
2089 bool ShellUtil::GetUserSpecificRegistrySuffix(string16* suffix) { 2088 bool ShellUtil::GetUserSpecificRegistrySuffix(string16* suffix) {
2090 // Use a thread-safe cache for the user's suffix. 2089 // Use a thread-safe cache for the user's suffix.
2091 static base::LazyInstance<UserSpecificRegistrySuffix>::Leaky suffix_instance = 2090 static base::LazyInstance<UserSpecificRegistrySuffix>::Leaky suffix_instance =
2092 LAZY_INSTANCE_INITIALIZER; 2091 LAZY_INSTANCE_INITIALIZER;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
2146 // are any left...). 2145 // are any left...).
2147 if (free_bits >= 8 && next_byte_index < size) { 2146 if (free_bits >= 8 && next_byte_index < size) {
2148 free_bits -= 8; 2147 free_bits -= 8;
2149 bit_stream += bytes[next_byte_index++] << free_bits; 2148 bit_stream += bytes[next_byte_index++] << free_bits;
2150 } 2149 }
2151 } 2150 }
2152 2151
2153 DCHECK_EQ(ret.length(), encoded_length); 2152 DCHECK_EQ(ret.length(), encoded_length);
2154 return ret; 2153 return ret;
2155 } 2154 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698