OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/profile_resetter/automatic_profile_resetter.h" | 5 #include "chrome/browser/profile_resetter/automatic_profile_resetter.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 99 |
100 // If the currently active experiment group prescribes a |program| and | 100 // If the currently active experiment group prescribes a |program| and |
101 // |hash_seed| to use instead of the baked-in ones, retrieves those and returns | 101 // |hash_seed| to use instead of the baked-in ones, retrieves those and returns |
102 // true. Otherwise, returns false. | 102 // true. Otherwise, returns false. |
103 bool GetProgramAndHashSeedOverridesFromExperiment(std::string* program, | 103 bool GetProgramAndHashSeedOverridesFromExperiment(std::string* program, |
104 std::string* hash_seed) { | 104 std::string* hash_seed) { |
105 DCHECK(program); | 105 DCHECK(program); |
106 DCHECK(hash_seed); | 106 DCHECK(hash_seed); |
107 #if defined(GOOGLE_CHROME_BUILD) | 107 #if defined(GOOGLE_CHROME_BUILD) |
108 std::map<std::string, std::string> params; | 108 std::map<std::string, std::string> params; |
109 chrome_variations::GetVariationParams(kAutomaticProfileResetStudyName, | 109 variations::GetVariationParams(kAutomaticProfileResetStudyName, ¶ms); |
110 ¶ms); | |
111 if (params.count(kAutomaticProfileResetStudyProgramParameterName) && | 110 if (params.count(kAutomaticProfileResetStudyProgramParameterName) && |
112 params.count(kAutomaticProfileResetStudyHashSeedParameterName)) { | 111 params.count(kAutomaticProfileResetStudyHashSeedParameterName)) { |
113 program->swap(params[kAutomaticProfileResetStudyProgramParameterName]); | 112 program->swap(params[kAutomaticProfileResetStudyProgramParameterName]); |
114 hash_seed->swap(params[kAutomaticProfileResetStudyHashSeedParameterName]); | 113 hash_seed->swap(params[kAutomaticProfileResetStudyHashSeedParameterName]); |
115 return true; | 114 return true; |
116 } | 115 } |
117 #endif | 116 #endif |
118 return false; | 117 return false; |
119 } | 118 } |
120 | 119 |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 | 754 |
756 void AutomaticProfileResetter::FinishResetPromptFlow() { | 755 void AutomaticProfileResetter::FinishResetPromptFlow() { |
757 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 756 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
758 DCHECK(state_ == STATE_HAS_TRIGGERED_PROMPT || | 757 DCHECK(state_ == STATE_HAS_TRIGGERED_PROMPT || |
759 state_ == STATE_HAS_SHOWN_BUBBLE || | 758 state_ == STATE_HAS_SHOWN_BUBBLE || |
760 state_ == STATE_PERFORMING_RESET); | 759 state_ == STATE_PERFORMING_RESET); |
761 DCHECK(!evaluation_results_); | 760 DCHECK(!evaluation_results_); |
762 | 761 |
763 state_ = STATE_DONE; | 762 state_ = STATE_DONE; |
764 } | 763 } |
OLD | NEW |