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

Unified Diff: chrome/browser/ui/webui/options/browser_options_handler.cc

Issue 405383002: The consumer management enroll and unenroll buttons should only be visible to the device owner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a cross-platform compilation error. Created 6 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
Index: chrome/browser/ui/webui/options/browser_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc
index 35756cdcdb128e456b27b93935477ab1f28a7803..fc219855c06f2a710548ba974e124063dec2f00b 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -111,6 +111,7 @@
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/chromeos/reset/metrics.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
+#include "chrome/browser/chromeos/settings/device_settings_service.h"
#include "chrome/browser/chromeos/system/timezone_util.h"
#include "chrome/browser/policy/profile_policy_connector.h"
#include "chrome/browser/policy/profile_policy_connector_factory.h"
@@ -122,6 +123,7 @@
#include "components/policy/core/common/policy_service.h"
#include "components/user_manager/user.h"
#include "policy/policy_constants.h"
+#include "policy/proto/device_management_backend.pb.h"
#include "ui/gfx/image/image_skia.h"
#endif // defined(OS_CHROMEOS)
@@ -612,6 +614,14 @@ void BrowserOptionsHandler::GetLocalizedValues(base::DictionaryValue* values) {
CommandLine::ForCurrentProcess()->HasSwitch(
chromeos::switches::kEnableConsumerManagement));
+ const enterprise_management::PolicyData* policy_data =
+ chromeos::DeviceSettingsService::Get()->policy_data();
+ values->SetBoolean(
+ "consumerManagementEnrolled",
+ policy_data &&
+ policy_data->management_mode() ==
+ enterprise_management::PolicyData::CONSUMER_MANAGED);
+
RegisterTitle(values, "thirdPartyImeConfirmOverlay",
IDS_OPTIONS_SETTINGS_LANGUAGES_THIRD_PARTY_WARNING_TITLE);
#endif

Powered by Google App Engine
This is Rietveld 408576698