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

Side by Side Diff: chrome/installer/gcapi/gcapi_omaha_experiment.cc

Issue 1172183002: Move StartsWith[ASCII] to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util3
Patch Set: merger Created 5 years, 6 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
« no previous file with comments | « chrome/installer/gcapi/gcapi.cc ('k') | chrome/installer/util/delete_after_reboot_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "chrome/installer/gcapi/gcapi_omaha_experiment.h" 5 #include "chrome/installer/gcapi/gcapi_omaha_experiment.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/strings/string_split.h" 8 #include "base/strings/string_split.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 // Split the original labels by the label separator. 44 // Split the original labels by the label separator.
45 std::vector<base::string16> entries; 45 std::vector<base::string16> entries;
46 base::SplitString(original_labels, google_update::kExperimentLabelSeparator, 46 base::SplitString(original_labels, google_update::kExperimentLabelSeparator,
47 &entries); 47 &entries);
48 48
49 // Keep all labels, but the one we want to add/replace. 49 // Keep all labels, but the one we want to add/replace.
50 base::string16 new_labels; 50 base::string16 new_labels;
51 for (std::vector<base::string16>::const_iterator it = entries.begin(); 51 for (std::vector<base::string16>::const_iterator it = entries.begin();
52 it != entries.end(); ++it) { 52 it != entries.end(); ++it) {
53 if (!it->empty() && !StartsWith(*it, label + L"=", true)) { 53 if (!it->empty() && !base::StartsWith(*it, label + L"=", true)) {
54 new_labels += *it; 54 new_labels += *it;
55 new_labels += google_update::kExperimentLabelSeparator; 55 new_labels += google_update::kExperimentLabelSeparator;
56 } 56 }
57 } 57 }
58 58
59 new_labels.append( 59 new_labels.append(
60 gcapi_internals::GetGCAPIExperimentLabel(brand_code, label)); 60 gcapi_internals::GetGCAPIExperimentLabel(brand_code, label));
61 61
62 return GoogleUpdateSettings::SetExperimentLabels(system_level, 62 return GoogleUpdateSettings::SetExperimentLabels(system_level,
63 new_labels); 63 new_labels);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 bool SetReactivationExperimentLabels(const wchar_t* brand_code, 97 bool SetReactivationExperimentLabels(const wchar_t* brand_code,
98 int shell_mode) { 98 int shell_mode) {
99 return SetExperimentLabel(brand_code, gcapi_internals::kReactivationLabel, 99 return SetExperimentLabel(brand_code, gcapi_internals::kReactivationLabel,
100 shell_mode); 100 shell_mode);
101 } 101 }
102 102
103 bool SetRelaunchExperimentLabels(const wchar_t* brand_code, int shell_mode) { 103 bool SetRelaunchExperimentLabels(const wchar_t* brand_code, int shell_mode) {
104 return SetExperimentLabel(brand_code, gcapi_internals::kRelaunchLabel, 104 return SetExperimentLabel(brand_code, gcapi_internals::kRelaunchLabel,
105 shell_mode); 105 shell_mode);
106 } 106 }
OLDNEW
« no previous file with comments | « chrome/installer/gcapi/gcapi.cc ('k') | chrome/installer/util/delete_after_reboot_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698