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

Side by Side Diff: chrome/browser/chrome_elf_init_win.cc

Issue 421663003: Move variations component code to variations namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix Created 6 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/metrics/field_trial.h" 6 #include "base/metrics/field_trial.h"
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/metrics/sparse_histogram.h" 8 #include "base/metrics/sparse_histogram.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/win/registry.h" 10 #include "base/win/registry.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 // No point in trying to continue if the registry key isn't valid. 120 // No point in trying to continue if the registry key isn't valid.
121 if (!finch_blacklist_registry_key.Valid()) 121 if (!finch_blacklist_registry_key.Valid())
122 return; 122 return;
123 123
124 // Delete and recreate the key to clear the registry. 124 // Delete and recreate the key to clear the registry.
125 finch_blacklist_registry_key.DeleteKey(L""); 125 finch_blacklist_registry_key.DeleteKey(L"");
126 finch_blacklist_registry_key.Create( 126 finch_blacklist_registry_key.Create(
127 HKEY_CURRENT_USER, blacklist::kRegistryFinchListPath, KEY_SET_VALUE); 127 HKEY_CURRENT_USER, blacklist::kRegistryFinchListPath, KEY_SET_VALUE);
128 128
129 std::map<std::string, std::string> params; 129 std::map<std::string, std::string> params;
130 chrome_variations::GetVariationParams(kBrowserBlacklistTrialName, &params); 130 variations::GetVariationParams(kBrowserBlacklistTrialName, &params);
131 131
132 for (std::map<std::string, std::string>::iterator it = params.begin(); 132 for (std::map<std::string, std::string>::iterator it = params.begin();
133 it != params.end(); 133 it != params.end();
134 ++it) { 134 ++it) {
135 std::wstring name = base::UTF8ToWide(it->first); 135 std::wstring name = base::UTF8ToWide(it->first);
136 std::wstring val = base::UTF8ToWide(it->second); 136 std::wstring val = base::UTF8ToWide(it->second);
137 137
138 finch_blacklist_registry_key.WriteValue(name.c_str(), val.c_str()); 138 finch_blacklist_registry_key.WriteValue(name.c_str(), val.c_str());
139 } 139 }
140 } 140 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 197
198 blacklist_registry_key.WriteValue(blacklist::kBeaconAttemptCount, 198 blacklist_registry_key.WriteValue(blacklist::kBeaconAttemptCount,
199 static_cast<DWORD>(0)); 199 static_cast<DWORD>(0));
200 200
201 // Only report the blacklist as getting setup when both registry writes 201 // Only report the blacklist as getting setup when both registry writes
202 // succeed, since otherwise the blacklist wasn't properly setup. 202 // succeed, since otherwise the blacklist wasn't properly setup.
203 if (set_version == ERROR_SUCCESS && set_state == ERROR_SUCCESS) 203 if (set_version == ERROR_SUCCESS && set_state == ERROR_SUCCESS)
204 RecordBlacklistSetupEvent(BLACKLIST_SETUP_ENABLED); 204 RecordBlacklistSetupEvent(BLACKLIST_SETUP_ENABLED);
205 } 205 }
206 } 206 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_elf_init_unittest_win.cc ('k') | chrome/browser/extensions/api/metrics_private/metrics_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698