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

Unified Diff: chrome/browser/android/policy/policy_manager.h

Issue 1220683008: Move AppRestriction to Policy code out of //chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed the Delegate, reworked the relationship between classes 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
Index: chrome/browser/android/policy/policy_manager.h
diff --git a/chrome/browser/android/policy/policy_manager.h b/chrome/browser/android/policy/policy_manager.h
index a24650d6f131d61961b37c0b1d4f58dd1d046ae0..1250b022f9c4cb4280f1a33ee4f226983bbb4bc2 100644
--- a/chrome/browser/android/policy/policy_manager.h
+++ b/chrome/browser/android/policy/policy_manager.h
@@ -8,52 +8,28 @@
#include <jni.h>
#include "base/android/jni_weak_ref.h"
-#include "components/policy/core/common/policy_bundle.h"
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
#include "components/policy/core/common/policy_provider_android_delegate.h"
namespace policy {
class PolicyProviderAndroid;
-class Schema;
-
-} // namespace policy
+class PolicyConverter;
Bernhard Bauer 2015/07/09 08:53:58 Add an empty line after this one, and add the name
dgn 2015/07/09 10:53:41 Done.
+}
class PolicyManager : public policy::PolicyProviderAndroidDelegate {
public:
PolicyManager(JNIEnv* env, jobject obj);
- // Called from Java:
- void SetPolicyBoolean(JNIEnv* env,
- jobject obj,
- jstring policyKey,
- jboolean value);
- void SetPolicyInteger(JNIEnv* env,
- jobject obj,
- jstring policyKey,
- jint value);
- void SetPolicyString(JNIEnv* env,
- jobject obj,
- jstring policyKey,
- jstring value);
- void SetPolicyStringArray(JNIEnv* env,
- jobject obj,
- jstring policyKey,
- jobjectArray value);
void FlushPolicies(JNIEnv* env, jobject obj);
void Destroy(JNIEnv* env, jobject obj);
- // Converts the passed in value to the type desired by the schema. If the
- // value is not convertible, it is returned unchanged, so the policy system
- // can report the error.
- // Note that this method will only look at the type of the schema, not at any
- // additional restrictions, or the schema for value's items or properties in
- // the case of a list or dictionary value.
- // This method takes ownership of the passed in value, and the caller takes
- // ownership of the return value.
- // Public for testing.
- static base::Value* ConvertValueToSchema(base::Value* raw_value,
- const policy::Schema& schema);
+ // Creates the native and java |PolicyConverter|, returns the reference to
+ // the java one.
+ base::android::ScopedJavaLocalRef<jobject> CreatePolicyConverter(JNIEnv* env,
+ jobject obj);
// PolicyProviderAndroidDelegate:
void RefreshPolicies() override;
@@ -64,11 +40,9 @@ class PolicyManager : public policy::PolicyProviderAndroidDelegate {
JavaObjectWeakGlobalRef weak_java_policy_manager_;
- scoped_ptr<policy::PolicyBundle> policy_bundle_;
+ scoped_ptr<policy::PolicyConverter> policy_converter_;
policy::PolicyProviderAndroid* policy_provider_;
- void SetPolicyValue(const std::string& key, base::Value* value);
-
DISALLOW_COPY_AND_ASSIGN(PolicyManager);
};

Powered by Google App Engine
This is Rietveld 408576698