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

Side by Side Diff: chrome/browser/metrics/variations/variations_service.cc

Issue 1320503005: Revert of Turn VariationsService::GetVariationsServerURL into instance method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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/browser/metrics/variations/variations_service.h" 5 #include "chrome/browser/metrics/variations/variations_service.h"
6 6
7 #include "base/build_time.h" 7 #include "base/build_time.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/metrics/sparse_histogram.h" 10 #include "base/metrics/sparse_histogram.h"
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 // This should be called before the server URL has been computed. 358 // This should be called before the server URL has been computed.
359 DCHECK(variations_server_url_.is_empty()); 359 DCHECK(variations_server_url_.is_empty());
360 restrict_mode_ = restrict_mode; 360 restrict_mode_ = restrict_mode;
361 } 361 }
362 362
363 void VariationsService::SetCreateTrialsFromSeedCalledForTesting(bool called) { 363 void VariationsService::SetCreateTrialsFromSeedCalledForTesting(bool called) {
364 DCHECK(thread_checker_.CalledOnValidThread()); 364 DCHECK(thread_checker_.CalledOnValidThread());
365 create_trials_from_seed_called_ = called; 365 create_trials_from_seed_called_ = called;
366 } 366 }
367 367
368 // static
368 GURL VariationsService::GetVariationsServerURL( 369 GURL VariationsService::GetVariationsServerURL(
369 PrefService* policy_pref_service, 370 PrefService* policy_pref_service,
370 const std::string& restrict_mode_override) { 371 const std::string& restrict_mode_override) {
371 std::string server_url_string( 372 std::string server_url_string(
372 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 373 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
373 switches::kVariationsServerURL)); 374 switches::kVariationsServerURL));
374 if (server_url_string.empty()) 375 if (server_url_string.empty())
375 server_url_string = kDefaultServerUrl; 376 server_url_string = kDefaultServerUrl;
376 GURL server_url = GURL(server_url_string); 377 GURL server_url = GURL(server_url_string);
377 378
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 // Otherwise, update the pref with the current Chrome version and country. 748 // Otherwise, update the pref with the current Chrome version and country.
748 base::ListValue new_list_value; 749 base::ListValue new_list_value;
749 new_list_value.AppendString(version.GetString()); 750 new_list_value.AppendString(version.GetString());
750 new_list_value.AppendString(latest_country); 751 new_list_value.AppendString(latest_country);
751 local_state_->Set(prefs::kVariationsPermanentConsistencyCountry, 752 local_state_->Set(prefs::kVariationsPermanentConsistencyCountry,
752 new_list_value); 753 new_list_value);
753 return latest_country; 754 return latest_country;
754 } 755 }
755 756
756 } // namespace chrome_variations 757 } // namespace chrome_variations
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698