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

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: 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 e7197633088b3bcf2e0877c5aa98af6322107c59..bf5bd5f4048c8e63cc41012be004da0b6d5884a7 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -112,6 +112,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_namespace.h"
#include "components/policy/core/common/policy_service.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)
@@ -144,6 +146,8 @@ using content::Referrer;
using extensions::Extension;
using extensions::ExtensionRegistry;
+namespace em = enterprise_management;
+
namespace {
#if defined(OS_WIN)
@@ -612,6 +616,13 @@ void BrowserOptionsHandler::GetLocalizedValues(base::DictionaryValue* values) {
CommandLine::ForCurrentProcess()->HasSwitch(
chromeos::switches::kEnableConsumerManagement));
+ const em::PolicyData* policy_data =
bartfab (slow) 2014/07/23 19:27:13 Nit: Un-indent one space.
davidyu 2014/07/24 04:28:30 Done.
+ chromeos::DeviceSettingsService::Get()->policy_data();
bartfab (slow) 2014/07/23 19:27:13 Nit: Un-indent one space.
davidyu 2014/07/24 04:28:30 Done.
+ values->SetBoolean(
+ "consumerManagementEnrolled",
+ policy_data &&
+ policy_data->management_mode() == em::PolicyData::CONSUMER_MANAGED);
+
RegisterTitle(values, "thirdPartyImeConfirmOverlay",
IDS_OPTIONS_SETTINGS_LANGUAGES_THIRD_PARTY_WARNING_TITLE);
#endif

Powered by Google App Engine
This is Rietveld 408576698