Chromium Code Reviews| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 67 return nullptr; | 67 return nullptr; |
| 68 #elif defined(OS_LINUX) && !defined(OS_CHROMEOS) | 68 #elif defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 69 if (!(platform & PLATFORM_LINUX)) | 69 if (!(platform & PLATFORM_LINUX)) |
| 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) |
|
msramek
2016/08/31 08:48:06
optional nit: We could join the two blocks (i.e. !
raymes
2016/09/01 00:17:01
Hmm I think it's about the same to leave them sepa
| |
| 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 | |
| 84 // and all the other content setting types are not used in iOS currently. So | |
| 85 // make content settings unsyncable on iOS for now. | |
| 86 // TODO(lshang): address this once we have proper content settings on iOS. | |
| 87 sync_status = WebsiteSettingsInfo::UNSYNCABLE; | 87 sync_status = WebsiteSettingsInfo::UNSYNCABLE; |
| 88 #else | 88 #else |
| 89 #error "Unsupported platform" | 89 #error "Unsupported platform" |
| 90 #endif | 90 #endif |
| 91 | 91 |
| 92 WebsiteSettingsInfo* info = new WebsiteSettingsInfo( | 92 WebsiteSettingsInfo* info = new WebsiteSettingsInfo( |
| 93 type, name, std::move(initial_default_value), sync_status, lossy_status, | 93 type, name, std::move(initial_default_value), sync_status, lossy_status, |
| 94 scoping_type, incognito_behavior); | 94 scoping_type, incognito_behavior); |
| 95 website_settings_info_[info->type()] = base::WrapUnique(info); | 95 website_settings_info_[info->type()] = base::WrapUnique(info); |
| 96 return info; | 96 return info; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 141 WebsiteSettingsInfo::DONT_INHERIT_IN_INCOGNITO); | 141 WebsiteSettingsInfo::DONT_INHERIT_IN_INCOGNITO); |
| 142 Register(CONTENT_SETTINGS_TYPE_PROMPT_NO_DECISION_COUNT, | 142 Register(CONTENT_SETTINGS_TYPE_PROMPT_NO_DECISION_COUNT, |
| 143 "prompt-no-decision-count", nullptr, WebsiteSettingsInfo::UNSYNCABLE, | 143 "prompt-no-decision-count", nullptr, WebsiteSettingsInfo::UNSYNCABLE, |
| 144 WebsiteSettingsInfo::NOT_LOSSY, | 144 WebsiteSettingsInfo::NOT_LOSSY, |
| 145 WebsiteSettingsInfo::REQUESTING_ORIGIN_ONLY_SCOPE, | 145 WebsiteSettingsInfo::REQUESTING_ORIGIN_ONLY_SCOPE, |
| 146 DESKTOP | PLATFORM_ANDROID, | 146 DESKTOP | PLATFORM_ANDROID, |
| 147 WebsiteSettingsInfo::INHERIT_IN_INCOGNITO); | 147 WebsiteSettingsInfo::INHERIT_IN_INCOGNITO); |
| 148 } | 148 } |
| 149 | 149 |
| 150 } // namespace content_settings | 150 } // namespace content_settings |
| OLD | NEW |