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

Unified Diff: components/variations/client_filterable_state.cc

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/client_filterable_state.h ('k') | components/variations/service/variations_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/variations/client_filterable_state.cc
diff --git a/components/variations/client_filterable_state.cc b/components/variations/client_filterable_state.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0e36db82e70ee50edd56523ebe6c0a2e762e5d7d
--- /dev/null
+++ b/components/variations/client_filterable_state.cc
@@ -0,0 +1,35 @@
+// 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.
+
+#include "components/variations/client_filterable_state.h"
+
+#include "build/build_config.h"
+
+namespace variations {
+
+// static
+Study::Platform ClientFilterableState::GetCurrentPlatform() {
+#if defined(OS_WIN)
+ return Study::PLATFORM_WINDOWS;
+#elif defined(OS_IOS)
+ return Study::PLATFORM_IOS;
+#elif defined(OS_MACOSX)
+ return Study::PLATFORM_MAC;
+#elif defined(OS_CHROMEOS)
+ return Study::PLATFORM_CHROMEOS;
+#elif defined(OS_ANDROID)
+ return Study::PLATFORM_ANDROID;
+#elif defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
+ // Default BSD and SOLARIS to Linux to not break those builds, although these
+ // platforms are not officially supported by Chrome.
+ return Study::PLATFORM_LINUX;
+#else
+#error Unknown platform
+#endif
+}
+
+ClientFilterableState::ClientFilterableState() {}
+ClientFilterableState::~ClientFilterableState() {}
+
+} // namespace variations
« no previous file with comments | « components/variations/client_filterable_state.h ('k') | components/variations/service/variations_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698