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

Unified Diff: chrome/browser/extensions/api/enterprise_device_attributes/enterprise_device_attributes_api.cc

Issue 1306183007: Switch to id-based affiliation determination (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
Index: chrome/browser/extensions/api/enterprise_device_attributes/enterprise_device_attributes_api.cc
diff --git a/chrome/browser/extensions/api/enterprise_device_attributes/enterprise_device_attributes_api.cc b/chrome/browser/extensions/api/enterprise_device_attributes/enterprise_device_attributes_api.cc
index fe3bc1b2ab637f05a8276f74dedb83222245bf53..9a1e603cf9c7b4350b3fa03524c84f2f8f5cbb81 100644
--- a/chrome/browser/extensions/api/enterprise_device_attributes/enterprise_device_attributes_api.cc
+++ b/chrome/browser/extensions/api/enterprise_device_attributes/enterprise_device_attributes_api.cc
@@ -13,23 +13,17 @@
#include "chrome/common/extensions/api/enterprise_device_attributes.h"
#include "components/user_manager/user_manager.h"
+
Thiemo Nagel 2015/09/22 15:32:24 Please remove blank line.
peletskyi 2015/09/22 16:08:42 Done.
namespace extensions {
namespace {
-// Checks for the current browser context if the user is affiliated and the
-// device is enterprise managed.
+// Checks for the current browser context if the user is affiliated.
bool IsPermittedToGetDeviceId(content::BrowserContext* context) {
- policy::BrowserPolicyConnectorChromeOS* connector =
- g_browser_process->platform_part()->browser_policy_connector_chromeos();
-
const user_manager::User* user =
chromeos::ProfileHelper::Get()->GetUserByProfile(
Profile::FromBrowserContext(context));
-
- return connector->IsEnterpriseManaged() &&
- connector->GetUserAffiliation(user->email()) ==
- policy::USER_AFFILIATION_MANAGED;
+ return user->is_affiliated();
}
// Returns the directory device id for the permitted extensions or an empty

Powered by Google App Engine
This is Rietveld 408576698