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

Unified Diff: components/variations/client_filterable_state.h

Issue 2924983003: [Variations] Refactor all state used for study filtering into a container struct. (Closed)
Patch Set: A bit more cleanup Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/variations/BUILD.gn ('k') | components/variations/client_filterable_state.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/variations/client_filterable_state.h
diff --git a/components/variations/client_filterable_state.h b/components/variations/client_filterable_state.h
new file mode 100644
index 0000000000000000000000000000000000000000..c2671f37da31e0bab649adeb8fd83f78334b6aec
--- /dev/null
+++ b/components/variations/client_filterable_state.h
@@ -0,0 +1,56 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_VARIATIONS_CLIENT_FILTERABLE_STATE_H_
+#define COMPONENTS_VARIATIONS_CLIENT_FILTERABLE_STATE_H_
+
+#include "base/macros.h"
+#include "base/time/time.h"
+#include "base/version.h"
+#include "components/variations/proto/study.pb.h"
+
+namespace variations {
+
+// A contianer for all of the client state which is used for filtering studies.
+struct ClientFilterableState {
+ static Study::Platform GetCurrentPlatform();
+
+ ClientFilterableState();
+ ~ClientFilterableState();
+
+ // The system locale.
+ std::string locale;
+
+ // The date on which the variations seed was fetched.
+ base::Time reference_date;
+
+ // The Chrome version to filter on.
+ base::Version version;
+
+ // The Channel for this Chrome installation.
+ Study::Channel channel;
+
+ // The hardware form factor that Chrome is running on.
+ Study::FormFactor form_factor;
+
+ // The OS on which Chrome is running.
+ Study::Platform platform;
+
+ // The named hardware configuration that Chrome is running on -- used to
+ // identify models of devices.
+ std::string hardware_class;
+
+ // The country code to use for studies configured with session consistency.
+ std::string session_consistency_country;
+
+ // The country code to use for studies configured with permanent consistency.
+ std::string permanent_consistency_country;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ClientFilterableState);
+};
+
+} // namespace variations
+
+#endif // COMPONENTS_VARIATIONS_CLIENT_FILTERABLE_STATE_H_
« no previous file with comments | « components/variations/BUILD.gn ('k') | components/variations/client_filterable_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698