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

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

Issue 102843002: Move RemoveChars, ReplaceChars, TrimString, and TruncateUTF8ToByteSize to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after
1683 // at the beginning or end for things like usernames and paths). 1683 // at the beginning or end for things like usernames and paths).
1684 app_id.append(component.c_str(), 0, max_component_length / 2); 1684 app_id.append(component.c_str(), 0, max_component_length / 2);
1685 app_id.append(component.c_str(), 1685 app_id.append(component.c_str(),
1686 component.length() - ((max_component_length + 1) / 2), 1686 component.length() - ((max_component_length + 1) / 2),
1687 string16::npos); 1687 string16::npos);
1688 } else { 1688 } else {
1689 app_id.append(component); 1689 app_id.append(component);
1690 } 1690 }
1691 } 1691 }
1692 // No spaces are allowed in the AppUserModelId according to MSDN. 1692 // No spaces are allowed in the AppUserModelId according to MSDN.
1693 ReplaceChars(app_id, L" ", L"_", &app_id); 1693 base::ReplaceChars(app_id, L" ", L"_", &app_id);
1694 return app_id; 1694 return app_id;
1695 } 1695 }
1696 1696
1697 ShellUtil::DefaultState ShellUtil::GetChromeDefaultState() { 1697 ShellUtil::DefaultState ShellUtil::GetChromeDefaultState() {
1698 BrowserDistribution* distribution = BrowserDistribution::GetDistribution(); 1698 BrowserDistribution* distribution = BrowserDistribution::GetDistribution();
1699 if (distribution->GetDefaultBrowserControlPolicy() == 1699 if (distribution->GetDefaultBrowserControlPolicy() ==
1700 BrowserDistribution::DEFAULT_BROWSER_UNSUPPORTED) { 1700 BrowserDistribution::DEFAULT_BROWSER_UNSUPPORTED) {
1701 return NOT_DEFAULT; 1701 return NOT_DEFAULT;
1702 } 1702 }
1703 // When we check for default browser we don't necessarily want to count file 1703 // When we check for default browser we don't necessarily want to count file
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
2154 // are any left...). 2154 // are any left...).
2155 if (free_bits >= 8 && next_byte_index < size) { 2155 if (free_bits >= 8 && next_byte_index < size) {
2156 free_bits -= 8; 2156 free_bits -= 8;
2157 bit_stream += bytes[next_byte_index++] << free_bits; 2157 bit_stream += bytes[next_byte_index++] << free_bits;
2158 } 2158 }
2159 } 2159 }
2160 2160
2161 DCHECK_EQ(ret.length(), encoded_length); 2161 DCHECK_EQ(ret.length(), encoded_length);
2162 return ret; 2162 return ret;
2163 } 2163 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698