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";
const char kChromeUserPolicyType[] = "google/chromeos/user";
#elif defined(OS_ANDROID)
const char kChromeUserPolicyType[] = "google/android/user";
#elif defined(OS_IOS)
const char kChromeUserPolicyType[] = "google/ios/user";
#else
const char kChromeUserPolicyType[] = "google/chrome/user";
#endif
......@@ -48,7 +50,7 @@ const char kChromeExtensionPolicyType[] = "google/chrome/extension";
} // namespace dm_protocol
const char* GetChromeUserPolicyType() {
#if defined(OS_ANDROID)
#if defined(OS_ANDROID) || defined(OS_IOS)
CommandLine* command_line = CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kFakeCloudPolicyType))
return "google/chrome/user";
......
......@@ -105,7 +105,7 @@ enum DeviceMode {
typedef std::pair<std::string, std::string> PolicyNamespaceKey;
// 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.
// http://crbug.com/248527
const char* GetChromeUserPolicyType();
......
......@@ -25,6 +25,7 @@ message DeviceRegisterRequest {
DEVICE = 2; // Register for device policies.
BROWSER = 3; // Register for Chrome 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
// field is missing, then the request comes from TT. We will remove
......@@ -135,6 +136,7 @@ message PolicyFetchRequest {
// google/chromeos/publicaccount => ChromeSettingsProto
// google/chrome/extension => ExternalPolicyData
// google/android/user => ChromeSettingsProto
// google/ios/user => ChromeSettingsProto
optional string policy_type = 1;
// This is the last policy timestamp that client received from server.
......
......@@ -1476,6 +1476,13 @@ const char kPluginsMetadataServerURL[] = "plugins-metadata-server-url";
#if defined(OS_ANDROID) || defined(OS_IOS)
// Enable SPDY proxy.
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)
#if defined(OS_ANDROID)
......@@ -1489,11 +1496,6 @@ const char kEnableNewNTP[] = "enable-new-ntp";
// Pops the translate infobar if possible.
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.
const char kTabletUI[] = "tablet-ui";
#endif
......
......@@ -401,13 +401,13 @@ extern const char kPluginsMetadataServerURL[];
#if defined(OS_ANDROID) || defined(OS_IOS)
extern const char kEnableSpdyProxyAuth[];
extern const char kFakeCloudPolicyType[];
#endif // defined(OS_ANDROID) || defined(OS_IOS)
#if defined(OS_ANDROID)
extern const char kEnableAccessibilityTabSwitcher[];
extern const char kEnableNewNTP[];
extern const char kEnableTranslate[];
extern const char kFakeCloudPolicyType[];
extern const char kTabletUI[];
#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