| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/content_settings/core/browser/website_settings_registry.h" | 5 #include "components/content_settings/core/browser/website_settings_registry.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 return nullptr; | 70 return nullptr; |
| 71 #elif defined(OS_MACOSX) && !defined(OS_IOS) | 71 #elif defined(OS_MACOSX) && !defined(OS_IOS) |
| 72 if (!(platform & PLATFORM_MAC)) | 72 if (!(platform & PLATFORM_MAC)) |
| 73 return nullptr; | 73 return nullptr; |
| 74 #elif defined(OS_CHROMEOS) | 74 #elif defined(OS_CHROMEOS) |
| 75 if (!(platform & PLATFORM_CHROMEOS)) | 75 if (!(platform & PLATFORM_CHROMEOS)) |
| 76 return nullptr; | 76 return nullptr; |
| 77 #elif defined(OS_ANDROID) | 77 #elif defined(OS_ANDROID) |
| 78 if (!(platform & PLATFORM_ANDROID)) | 78 if (!(platform & PLATFORM_ANDROID)) |
| 79 return nullptr; | 79 return nullptr; |
| 80 // Don't sync settings to mobile platforms. The UI is different to desktop and |
| 81 // doesn't allow the settings to be managed in the same way. See |
| 82 // crbug.com/642184. |
| 83 sync_status = WebsiteSettingsInfo::UNSYNCABLE; |
| 80 #elif defined(OS_IOS) | 84 #elif defined(OS_IOS) |
| 81 if (!(platform & PLATFORM_IOS)) | 85 if (!(platform & PLATFORM_IOS)) |
| 82 return nullptr; | 86 return nullptr; |
| 83 // Only default settings for Cookies and Popups are used in iOS. Exceptions | 87 // Don't sync settings to mobile platforms. The UI is different to desktop and |
| 84 // and all the other content setting types are not used in iOS currently. So | 88 // doesn't allow the settings to be managed in the same way. See |
| 85 // make content settings unsyncable on iOS for now. | 89 // crbug.com/642184. |
| 86 // TODO(lshang): address this once we have proper content settings on iOS. | |
| 87 sync_status = WebsiteSettingsInfo::UNSYNCABLE; | 90 sync_status = WebsiteSettingsInfo::UNSYNCABLE; |
| 88 #else | 91 #else |
| 89 #error "Unsupported platform" | 92 #error "Unsupported platform" |
| 90 #endif | 93 #endif |
| 91 | 94 |
| 92 WebsiteSettingsInfo* info = new WebsiteSettingsInfo( | 95 WebsiteSettingsInfo* info = new WebsiteSettingsInfo( |
| 93 type, name, std::move(initial_default_value), sync_status, lossy_status, | 96 type, name, std::move(initial_default_value), sync_status, lossy_status, |
| 94 scoping_type, incognito_behavior); | 97 scoping_type, incognito_behavior); |
| 95 website_settings_info_[info->type()] = base::WrapUnique(info); | 98 website_settings_info_[info->type()] = base::WrapUnique(info); |
| 96 return info; | 99 return info; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 WebsiteSettingsInfo::DONT_INHERIT_IN_INCOGNITO); | 144 WebsiteSettingsInfo::DONT_INHERIT_IN_INCOGNITO); |
| 142 Register(CONTENT_SETTINGS_TYPE_PROMPT_NO_DECISION_COUNT, | 145 Register(CONTENT_SETTINGS_TYPE_PROMPT_NO_DECISION_COUNT, |
| 143 "prompt-no-decision-count", nullptr, WebsiteSettingsInfo::UNSYNCABLE, | 146 "prompt-no-decision-count", nullptr, WebsiteSettingsInfo::UNSYNCABLE, |
| 144 WebsiteSettingsInfo::NOT_LOSSY, | 147 WebsiteSettingsInfo::NOT_LOSSY, |
| 145 WebsiteSettingsInfo::REQUESTING_ORIGIN_ONLY_SCOPE, | 148 WebsiteSettingsInfo::REQUESTING_ORIGIN_ONLY_SCOPE, |
| 146 DESKTOP | PLATFORM_ANDROID, | 149 DESKTOP | PLATFORM_ANDROID, |
| 147 WebsiteSettingsInfo::INHERIT_IN_INCOGNITO); | 150 WebsiteSettingsInfo::INHERIT_IN_INCOGNITO); |
| 148 } | 151 } |
| 149 | 152 |
| 150 } // namespace content_settings | 153 } // namespace content_settings |
| OLD | NEW |