Commit 00f05790 authored by Chris Sharp's avatar Chris Sharp Committed by Commit Bot

Enable roaming profile support on mac and linux.

Don't add a default roaming profile location, so this feature
will only work when RoamingProfileLocation is set as well.

BUG:1145172

Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2507890
Commit-Queue: Chris Sharp <csharp@chromium.org>
Reviewed-by: default avatarJulian Pastarmov <pastarmovj@chromium.org>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#823795}
Change-Id: Ib90c9e8b81577514d842f5790b326ccef4e1b191
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2520245
Cr-Commit-Position: refs/heads/master@{#825384}
parent 0ac3472c
...@@ -40,14 +40,14 @@ class DeviceInfoSyncClient : public syncer::DeviceInfoSyncClient { ...@@ -40,14 +40,14 @@ class DeviceInfoSyncClient : public syncer::DeviceInfoSyncClient {
// syncer::DeviceInfoSyncClient: // syncer::DeviceInfoSyncClient:
std::string GetSigninScopedDeviceId() const override { std::string GetSigninScopedDeviceId() const override {
// Since the local sync backend is currently only supported on Windows don't // Since the local sync backend is currently only supported on Windows, Mac and
// even check the pref on other os-es. // Linux don't even check the pref on other os-es.
#if defined(OS_WIN) #if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX)
syncer::SyncPrefs prefs(profile_->GetPrefs()); syncer::SyncPrefs prefs(profile_->GetPrefs());
if (prefs.IsLocalSyncEnabled()) { if (prefs.IsLocalSyncEnabled()) {
return "local_device"; return "local_device";
} }
#endif // defined(OS_WIN) #endif // defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX)
return GetSigninScopedDeviceIdForProfile(profile_); return GetSigninScopedDeviceIdForProfile(profile_);
} }
......
...@@ -197,9 +197,9 @@ KeyedService* ProfileSyncServiceFactory::BuildServiceInstanceFor( ...@@ -197,9 +197,9 @@ KeyedService* ProfileSyncServiceFactory::BuildServiceInstanceFor(
bool local_sync_backend_enabled = false; bool local_sync_backend_enabled = false;
// Since the local sync backend is currently only supported on Windows don't // Only check the local sync backend pref on the supported platforms of
// even check the pref on other os-es. // Windows, Mac and Linux.
#if defined(OS_WIN) #if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX)
syncer::SyncPrefs prefs(profile->GetPrefs()); syncer::SyncPrefs prefs(profile->GetPrefs());
local_sync_backend_enabled = prefs.IsLocalSyncEnabled(); local_sync_backend_enabled = prefs.IsLocalSyncEnabled();
UMA_HISTOGRAM_BOOLEAN("Sync.Local.Enabled", local_sync_backend_enabled); UMA_HISTOGRAM_BOOLEAN("Sync.Local.Enabled", local_sync_backend_enabled);
...@@ -217,7 +217,7 @@ KeyedService* ProfileSyncServiceFactory::BuildServiceInstanceFor( ...@@ -217,7 +217,7 @@ KeyedService* ProfileSyncServiceFactory::BuildServiceInstanceFor(
init_params.start_behavior = syncer::ProfileSyncService::AUTO_START; init_params.start_behavior = syncer::ProfileSyncService::AUTO_START;
} }
#endif // defined(OS_WIN) #endif // defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX)
if (!local_sync_backend_enabled) { if (!local_sync_backend_enabled) {
// Always create the GCMProfileService instance such that we can listen to // Always create the GCMProfileService instance such that we can listen to
......
...@@ -66,8 +66,8 @@ class LocalSyncTest : public InProcessBrowserTest { ...@@ -66,8 +66,8 @@ class LocalSyncTest : public InProcessBrowserTest {
DISALLOW_COPY_AND_ASSIGN(LocalSyncTest); DISALLOW_COPY_AND_ASSIGN(LocalSyncTest);
}; };
// The local sync backend is currently only supported on Windows. // The local sync backend is currently only supported on Windows, Mac and Linux.
#if defined(OS_WIN) #if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX)
IN_PROC_BROWSER_TEST_F(LocalSyncTest, ShouldStart) { IN_PROC_BROWSER_TEST_F(LocalSyncTest, ShouldStart) {
ProfileSyncService* service = ProfileSyncService* service =
ProfileSyncServiceFactory::GetAsProfileSyncServiceForProfile( ProfileSyncServiceFactory::GetAsProfileSyncServiceForProfile(
...@@ -86,17 +86,22 @@ IN_PROC_BROWSER_TEST_F(LocalSyncTest, ShouldStart) { ...@@ -86,17 +86,22 @@ IN_PROC_BROWSER_TEST_F(LocalSyncTest, ShouldStart) {
// Windows. // Windows.
// TODO(crbug.com/1109640): Consider whether all of these types should really // TODO(crbug.com/1109640): Consider whether all of these types should really
// be enabled in Local Sync mode. // be enabled in Local Sync mode.
EXPECT_EQ(service->GetActiveDataTypes(), syncer::ModelTypeSet expected_active_data_types = syncer::ModelTypeSet(
syncer::ModelTypeSet( syncer::BOOKMARKS, syncer::PREFERENCES, syncer::PASSWORDS,
syncer::BOOKMARKS, syncer::PREFERENCES, syncer::PASSWORDS, syncer::AUTOFILL_PROFILE, syncer::AUTOFILL, syncer::AUTOFILL_WALLET_DATA,
syncer::AUTOFILL_PROFILE, syncer::AUTOFILL, syncer::AUTOFILL_WALLET_METADATA, syncer::THEMES, syncer::TYPED_URLS,
syncer::AUTOFILL_WALLET_DATA, syncer::AUTOFILL_WALLET_METADATA, syncer::EXTENSIONS, syncer::SEARCH_ENGINES, syncer::SESSIONS,
syncer::THEMES, syncer::TYPED_URLS, syncer::EXTENSIONS, syncer::APPS, syncer::APP_SETTINGS, syncer::EXTENSION_SETTINGS,
syncer::SEARCH_ENGINES, syncer::SESSIONS, syncer::APPS, syncer::HISTORY_DELETE_DIRECTIVES, syncer::DEVICE_INFO,
syncer::APP_SETTINGS, syncer::EXTENSION_SETTINGS, syncer::PRIORITY_PREFERENCES, syncer::WEB_APPS, syncer::PROXY_TABS,
syncer::HISTORY_DELETE_DIRECTIVES, syncer::DICTIONARY, syncer::NIGORI);
syncer::DEVICE_INFO, syncer::PRIORITY_PREFERENCES,
syncer::WEB_APPS, syncer::PROXY_TABS, syncer::NIGORI)); // The dictionary is currently only synced on Windows and Linux.
#if defined(OS_WIN) || defined(OS_LINUX)
expected_active_data_types.Put(syncer::DICTIONARY);
#endif
EXPECT_EQ(service->GetActiveDataTypes(), expected_active_data_types);
// Verify certain features are disabled. // Verify certain features are disabled.
EXPECT_FALSE(service->GetActiveDataTypes().Has(syncer::USER_CONSENTS)); EXPECT_FALSE(service->GetActiveDataTypes().Has(syncer::USER_CONSENTS));
...@@ -106,6 +111,6 @@ IN_PROC_BROWSER_TEST_F(LocalSyncTest, ShouldStart) { ...@@ -106,6 +111,6 @@ IN_PROC_BROWSER_TEST_F(LocalSyncTest, ShouldStart) {
EXPECT_FALSE(service->GetActiveDataTypes().Has(syncer::SHARING_MESSAGE)); EXPECT_FALSE(service->GetActiveDataTypes().Has(syncer::SHARING_MESSAGE));
EXPECT_FALSE(send_tab_to_self::IsUserSyncTypeActive(browser()->profile())); EXPECT_FALSE(send_tab_to_self::IsUserSyncTypeActive(browser()->profile()));
} }
#endif // defined(OS_WIN) #endif // defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX)
} // namespace } // namespace
...@@ -3577,7 +3577,7 @@ ...@@ -3577,7 +3577,7 @@
}, },
"RoamingProfileSupportEnabled": { "RoamingProfileSupportEnabled": {
"os": ["win"], "os": ["win", "linux", "mac"],
"policy_pref_mapping_test": [ "policy_pref_mapping_test": [
{ {
"policies": { "policies": {
...@@ -3589,7 +3589,7 @@ ...@@ -3589,7 +3589,7 @@
}, },
"RoamingProfileLocation": { "RoamingProfileLocation": {
"os": ["win"], "os": ["win", "linux", "mac"],
"policy_pref_mapping_test": [ "policy_pref_mapping_test": [
{ {
"policies": { "policies": {
......
...@@ -3487,7 +3487,7 @@ ...@@ -3487,7 +3487,7 @@
'owners': ['file://components/policy/resources/OWNERS'], 'owners': ['file://components/policy/resources/OWNERS'],
'type': 'main', 'type': 'main',
'schema': { 'type': 'boolean' }, 'schema': { 'type': 'boolean' },
'supported_on': ['chrome.win:57-'], 'supported_on': ['chrome.win:57-', 'chrome.mac:88-', 'chrome.linux:88-'],
'features': { 'features': {
'dynamic_refresh': False, 'dynamic_refresh': False,
'per_profile': False, 'per_profile': False,
...@@ -3508,7 +3508,7 @@ ...@@ -3508,7 +3508,7 @@
'owners': ['file://components/policy/resources/OWNERS'], 'owners': ['file://components/policy/resources/OWNERS'],
'type': 'string', 'type': 'string',
'schema': { 'type': 'string' }, 'schema': { 'type': 'string' },
'supported_on': ['chrome.win:57-'], 'supported_on': ['chrome.win:57-', 'chrome.mac:88-', 'chrome.linux:88-'],
'features': { 'features': {
'dynamic_refresh': False, 'dynamic_refresh': False,
'per_profile': False, 'per_profile': False,
...@@ -3523,7 +3523,9 @@ ...@@ -3523,7 +3523,9 @@
See https://www.chromium.org/administrators/policy-list-3/user-data-directory-variables for a list of variables that can be used. See https://www.chromium.org/administrators/policy-list-3/user-data-directory-variables for a list of variables that can be used.
If this policy is left not set the default roaming profile path will be used.''', On non-Windows platforms, this policy must be set for roaming profiles to work.
On Windows, if this policy is left unset, the default roaming profile path will be used.''',
'label': '''Set the roaming profile directory''', 'label': '''Set the roaming profile directory''',
}, },
{ {
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