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

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

Issue 147723010: Expose a method in VariationsService to trigger a seed fetch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ensure onappforeground fetch doesn't trigger if start already has Created 6 years, 10 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 #ifndef CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SERVICE_H_ 5 #ifndef CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SERVICE_H_
6 #define CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SERVICE_H_ 6 #define CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SERVICE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // Calls FetchVariationsSeed once and repeats this periodically. See 50 // Calls FetchVariationsSeed once and repeats this periodically. See
51 // implementation for details on the period. Must be called after 51 // implementation for details on the period. Must be called after
52 // |CreateTrialsFromSeed|. 52 // |CreateTrialsFromSeed|.
53 void StartRepeatedVariationsSeedFetch(); 53 void StartRepeatedVariationsSeedFetch();
54 54
55 // Returns the variations server URL, which can vary if a command-line flag is 55 // Returns the variations server URL, which can vary if a command-line flag is
56 // set and/or the variations restrict pref is set in |local_prefs|. Declared 56 // set and/or the variations restrict pref is set in |local_prefs|. Declared
57 // static for test purposes. 57 // static for test purposes.
58 static GURL GetVariationsServerURL(PrefService* local_prefs); 58 static GURL GetVariationsServerURL(PrefService* local_prefs);
59 59
60 // Called when the application enters foreground. This may trigger a
61 // FetchVariationsSeed call.
62 // TODO(rkaplow): Handle this and the similar event in metrics_service by
63 // observing an 'OnAppEnterForeground' event instead of requiring the frontend
64 // code to notify each service individually.
65 void OnAppEnterForeground();
66
60 #if defined(OS_WIN) 67 #if defined(OS_WIN)
61 // Starts syncing Google Update Variation IDs with the registry. 68 // Starts syncing Google Update Variation IDs with the registry.
62 void StartGoogleUpdateRegistrySync(); 69 void StartGoogleUpdateRegistrySync();
63 #endif 70 #endif
64 71
65 // Exposed for testing. 72 // Exposed for testing.
66 void SetCreateTrialsFromSeedCalledForTesting(bool called); 73 void SetCreateTrialsFromSeedCalledForTesting(bool called);
67 74
68 // Exposed for testing. 75 // Exposed for testing.
69 static std::string GetDefaultVariationsServerURLForTesting(); 76 static std::string GetDefaultVariationsServerURLForTesting();
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 // Helper that handles synchronizing Variations with the Registry. 168 // Helper that handles synchronizing Variations with the Registry.
162 VariationsRegistrySyncer registry_syncer_; 169 VariationsRegistrySyncer registry_syncer_;
163 #endif 170 #endif
164 171
165 DISALLOW_COPY_AND_ASSIGN(VariationsService); 172 DISALLOW_COPY_AND_ASSIGN(VariationsService);
166 }; 173 };
167 174
168 } // namespace chrome_variations 175 } // namespace chrome_variations
169 176
170 #endif // CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SERVICE_H_ 177 #endif // CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698