Added cloud policy registration and fetch types for iOS.

The --fake-cloud-policy-type flag has also been enabled for iOS, for testing
purposes.

BUG=285084

Review URL: https://chromiumcodereview.appspot.com/23475018

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221359 0039d316-1c4b-4281-b951-d872f2087c98
parent 02f04a82
...@@ -39,6 +39,8 @@ const char kChromeDevicePolicyType[] = "google/chromeos/device"; ...@@ -39,6 +39,8 @@ const char kChromeDevicePolicyType[] = "google/chromeos/device";
const char kChromeUserPolicyType[] = "google/chromeos/user"; const char kChromeUserPolicyType[] = "google/chromeos/user";
#elif defined(OS_ANDROID) #elif defined(OS_ANDROID)
const char kChromeUserPolicyType[] = "google/android/user"; const char kChromeUserPolicyType[] = "google/android/user";
#elif defined(OS_IOS)
const char kChromeUserPolicyType[] = "google/ios/user";
#else #else
const char kChromeUserPolicyType[] = "google/chrome/user"; const char kChromeUserPolicyType[] = "google/chrome/user";
#endif #endif
...@@ -48,7 +50,7 @@ const char kChromeExtensionPolicyType[] = "google/chrome/extension"; ...@@ -48,7 +50,7 @@ const char kChromeExtensionPolicyType[] = "google/chrome/extension";
} // namespace dm_protocol } // namespace dm_protocol
const char* GetChromeUserPolicyType() { const char* GetChromeUserPolicyType() {
#if defined(OS_ANDROID) #if defined(OS_ANDROID) || defined(OS_IOS)
CommandLine* command_line = CommandLine::ForCurrentProcess(); CommandLine* command_line = CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kFakeCloudPolicyType)) if (command_line->HasSwitch(switches::kFakeCloudPolicyType))
return "google/chrome/user"; return "google/chrome/user";
......
...@@ -105,7 +105,7 @@ enum DeviceMode { ...@@ -105,7 +105,7 @@ enum DeviceMode {
typedef std::pair<std::string, std::string> PolicyNamespaceKey; typedef std::pair<std::string, std::string> PolicyNamespaceKey;
// Returns the Chrome user policy type to use. This allows overridding the // Returns the Chrome user policy type to use. This allows overridding the
// default user policy type on Android for testing purposes. // default user policy type on Android and iOS for testing purposes.
// TODO(joaodasilva): remove this once the server is ready. // TODO(joaodasilva): remove this once the server is ready.
// http://crbug.com/248527 // http://crbug.com/248527
const char* GetChromeUserPolicyType(); const char* GetChromeUserPolicyType();
......
...@@ -20,11 +20,12 @@ message DeviceRegisterRequest { ...@@ -20,11 +20,12 @@ message DeviceRegisterRequest {
// client has been registered properly. For example, a client must // client has been registered properly. For example, a client must
// register with type DEVICE in order to retrieve device policies. // register with type DEVICE in order to retrieve device policies.
enum Type { enum Type {
TT = 0; // Register for TT release. TT = 0; // Register for TT release.
USER = 1; // Register for Chrome OS user polices. USER = 1; // Register for Chrome OS user polices.
DEVICE = 2; // Register for device policies. DEVICE = 2; // Register for device policies.
BROWSER = 3; // Register for Chrome user policies. BROWSER = 3; // Register for Chrome user policies.
ANDROID_BROWSER = 4; // Register for Android Chrome browser user policies. ANDROID_BROWSER = 4; // Register for Android Chrome browser user policies.
IOS_BROWSER = 5; // Register for iOS Chrome browser user policies.
} }
// NOTE: we also use this field to detect client version. If this // NOTE: we also use this field to detect client version. If this
// field is missing, then the request comes from TT. We will remove // field is missing, then the request comes from TT. We will remove
...@@ -135,6 +136,7 @@ message PolicyFetchRequest { ...@@ -135,6 +136,7 @@ message PolicyFetchRequest {
// google/chromeos/publicaccount => ChromeSettingsProto // google/chromeos/publicaccount => ChromeSettingsProto
// google/chrome/extension => ExternalPolicyData // google/chrome/extension => ExternalPolicyData
// google/android/user => ChromeSettingsProto // google/android/user => ChromeSettingsProto
// google/ios/user => ChromeSettingsProto
optional string policy_type = 1; optional string policy_type = 1;
// This is the last policy timestamp that client received from server. // This is the last policy timestamp that client received from server.
......
...@@ -1476,6 +1476,13 @@ const char kPluginsMetadataServerURL[] = "plugins-metadata-server-url"; ...@@ -1476,6 +1476,13 @@ const char kPluginsMetadataServerURL[] = "plugins-metadata-server-url";
#if defined(OS_ANDROID) || defined(OS_IOS) #if defined(OS_ANDROID) || defined(OS_IOS)
// Enable SPDY proxy. // Enable SPDY proxy.
const char kEnableSpdyProxyAuth[] = "enable-spdy-proxy-auth"; const char kEnableSpdyProxyAuth[] = "enable-spdy-proxy-auth";
// Registers for cloud policy using the BROWSER client type instead of the
// ANDROID_BROWSER or IOS_BROWSER types.
// This allows skipping the server whitelist.
// TODO(joaodasilva): remove this. http://crbug.com/248527
const char kFakeCloudPolicyType[] = "fake-cloud-policy-type";
#endif // defined(OS_ANDROID) || defined(OS_IOS) #endif // defined(OS_ANDROID) || defined(OS_IOS)
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
...@@ -1489,11 +1496,6 @@ const char kEnableNewNTP[] = "enable-new-ntp"; ...@@ -1489,11 +1496,6 @@ const char kEnableNewNTP[] = "enable-new-ntp";
// Pops the translate infobar if possible. // Pops the translate infobar if possible.
const char kEnableTranslate[] = "enable-translate"; const char kEnableTranslate[] = "enable-translate";
// Registers for cloud policy using the BROWSER client type instead of the
// ANDROID_BROWSER type. This enables skipping the server whitelist.
// TODO(joaodasilva): remove this. http://crbug.com/248527
const char kFakeCloudPolicyType[] = "fake-cloud-policy-type";
// Uses the tablet specific UI components when available. // Uses the tablet specific UI components when available.
const char kTabletUI[] = "tablet-ui"; const char kTabletUI[] = "tablet-ui";
#endif #endif
......
...@@ -401,13 +401,13 @@ extern const char kPluginsMetadataServerURL[]; ...@@ -401,13 +401,13 @@ extern const char kPluginsMetadataServerURL[];
#if defined(OS_ANDROID) || defined(OS_IOS) #if defined(OS_ANDROID) || defined(OS_IOS)
extern const char kEnableSpdyProxyAuth[]; extern const char kEnableSpdyProxyAuth[];
extern const char kFakeCloudPolicyType[];
#endif // defined(OS_ANDROID) || defined(OS_IOS) #endif // defined(OS_ANDROID) || defined(OS_IOS)
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
extern const char kEnableAccessibilityTabSwitcher[]; extern const char kEnableAccessibilityTabSwitcher[];
extern const char kEnableNewNTP[]; extern const char kEnableNewNTP[];
extern const char kEnableTranslate[]; extern const char kEnableTranslate[];
extern const char kFakeCloudPolicyType[];
extern const char kTabletUI[]; extern const char kTabletUI[];
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment