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

Unified Diff: chrome/browser/chromeos/extensions/echo_private_api.cc

Issue 12147004: Disable/enable echo for enterprise device. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update some inline comments. Created 7 years, 10 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/chromeos/extensions/echo_private_api.cc
diff --git a/chrome/browser/chromeos/extensions/echo_private_api.cc b/chrome/browser/chromeos/extensions/echo_private_api.cc
index 51f195dbf4e0e44638fb24e52fb98891c716a1bf..8c81a6d0e5bea98eb4a89f389a44faddd3d5c0f8 100644
--- a/chrome/browser/chromeos/extensions/echo_private_api.cc
+++ b/chrome/browser/chromeos/extensions/echo_private_api.cc
@@ -14,6 +14,7 @@
#include "base/time.h"
#include "base/values.h"
#include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h"
+#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/chromeos/system/statistics_provider.h"
#include "chrome/common/extensions/extension.h"
#include "content/public/browser/browser_thread.h"
@@ -98,3 +99,23 @@ bool GetOobeTimestampFunction::GetOobeTimestampOnFileThread() {
SetResult(new base::StringValue(timestamp));
return true;
}
+
+AllowRedeemOffersFunction::AllowRedeemOffersFunction() {
+}
+
+AllowRedeemOffersFunction::~AllowRedeemOffersFunction() {
+}
+
+// Check the enterprise policy kAllowRedeemChromeOsRegistrationOffers flag
+// value. This policy is used to controll whether user can redeem offers using
+// enterprise device.
+bool AllowRedeemOffersFunction::RunImpl() {
+ bool allow = true;
+ // If the policy is not provided, "allow" will not be modified by
+ // GetBoolean.
+ // TODO(oscarpan): Check if we need to use PreparedTrustedValues.
Mattias Nissler (ping if slow) 2013/02/05 13:06:53 You should be using this. As pointed out by Xiyuan
oscarpan 2013/02/06 04:34:54 Done.
+ chromeos::CrosSettings::Get()->GetBoolean(
+ chromeos::kAllowRedeemChromeOsRegistrationOffers, &allow);
+ SetResult(new base::FundamentalValue(allow));
+ return true;
+}

Powered by Google App Engine
This is Rietveld 408576698