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

Unified Diff: chrome/browser/chromeos/login/users/affiliation.h

Issue 1266563002: Added affiliation IDs for the new affiliation determination. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | « no previous file | chrome/browser/chromeos/login/users/affiliation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/users/affiliation.h
diff --git a/chrome/browser/chromeos/login/users/affiliation.h b/chrome/browser/chromeos/login/users/affiliation.h
new file mode 100644
index 0000000000000000000000000000000000000000..877d3a57e92da7af2cf87d7b1c76d2ab6812a004
--- /dev/null
+++ b/chrome/browser/chromeos/login/users/affiliation.h
@@ -0,0 +1,30 @@
+// Copyright 2015 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 CHROME_BROWSER_CHROMEOS_LOGIN_USERS_AFFILIATION_H_
+#define CHROME_BROWSER_CHROMEOS_LOGIN_USERS_AFFILIATION_H_
+
+#include <set>
+#include <string>
+
+namespace chromeos {
+// Returns true if there is at least one common element in two sets.
+// Complexity: O(n + m), where n - size of the first set, m - size of
+// the second set.
+bool HaveCommonElement(const std::set<std::string>& set1,
Dmitry Polukhin 2015/07/30 15:14:11 I think it would be good to add typedef for std::s
peletskyi 2015/07/30 16:39:49 Done everywhere except this function. To HaveCommo
+ const std::set<std::string>& set2);
+
+// TODO(b/515476): Remove email and enterprise domain after affiliation
+// based implementation will fully work.
+// The function makes a decision if user with |user_affiliation_ids| and
+// |email| is affiliated on the device with |device_affiliation_ids| and
+// |enterprise_domain|.
+bool IsUserAffiliated(const std::set<std::string>& user_affiliation_ids,
+ const std::set<std::string>& device_affiliation_ids,
+ const std::string& email,
+ const std::string& enterprise_domain);
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_AFFILIATION_H_
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/users/affiliation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698