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

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

Issue 811283002: [Installer] Cleaning up dead code for App Launcher / App Host installs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanups; handle ChannelInfo to remove '-apphost' and '-applauncher'. Created 5 years, 11 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
OLDNEW
(Empty)
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #if defined(GOOGLE_CHROME_BUILD)
6
7 #include "base/strings/string_util.h"
8 #include "chrome/installer/util/app_launcher_installer_util.h"
9
10 namespace installer {
11 namespace app_launcher_installer {
12
13 namespace {
14
15 const wchar_t kModSeparator[] = L"-";
16 const wchar_t kModAppHostWithSeparator[] = L"-apphost-";
17 const wchar_t kModAppLauncherWithSeparator[] = L"-applauncher-";
18
19 } // namespace
20
21 // To remove "-test" from "-abc-test-efg", we:
22 // (1) add sentinel "-" to the end to form "-abc-test-efg-",
23 // (2) search for "-test" + "-" = "-test-",
24 // (3) if found, replace substring with "-" to get "-abc-efg-",
25 // (4) remove trialing "-" to get "-abc-efg".
26 void RemoveDeprecatedModifiers(base::string16* value) {
27 value->push_back(kModSeparator[0]); // Add sentinel.
28 ReplaceFirstSubstringAfterOffset(
29 value, 0, kModAppHostWithSeparator, kModSeparator);
30 ReplaceFirstSubstringAfterOffset(
31 value, 0, kModAppLauncherWithSeparator, kModSeparator);
32 value->pop_back(); // Remove sentinel.
33 }
34
35 } // namespace app_launcher_installer
36 } // namespace installer
37
38 #endif // defined(GOOGLE_CHROME_BUILD)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698