Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(381)

Unified Diff: components/content_settings/core/browser/website_settings_registry.cc

Issue 1991623005: Only Register() platform specific content settings types on different platforms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/content_settings/core/browser/website_settings_registry.cc
diff --git a/components/content_settings/core/browser/website_settings_registry.cc b/components/content_settings/core/browser/website_settings_registry.cc
index f6eac0eff96d4c7cfa980259122912e143e2c70b..71a28ef77bffe9636dadf9a511d53f5077d094df 100644
--- a/components/content_settings/core/browser/website_settings_registry.cc
+++ b/components/content_settings/core/browser/website_settings_registry.cc
@@ -5,7 +5,7 @@
#include "components/content_settings/core/browser/website_settings_registry.h"
#include <utility>
-
+#include <iostream>
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "components/content_settings/core/common/content_settings.h"
@@ -59,7 +59,34 @@ const WebsiteSettingsInfo* WebsiteSettingsRegistry::Register(
WebsiteSettingsInfo::SyncStatus sync_status,
WebsiteSettingsInfo::LossyStatus lossy_status,
WebsiteSettingsInfo::ScopingType scoping_type,
+ uint32_t platform,
WebsiteSettingsInfo::IncognitoBehavior incognito_behavior) {
+std::cout << "+++++++++" << type << "++++++" << platform << "++++++++" << (platform & WebsiteSettingsInfo::PLATFORM_IOS) << std::endl;
+
+#if defined(OS_IOS)
+std::cout << "OS_IOS" << std::endl;
+#endif
+
+#if defined(OS_WIN)
+ if (!(platform & WebsiteSettingsInfo::PLATFORM_WINDOWS))
+ return nullptr;
+#elif defined(OS_LINUX)
+ if (!(platform & WebsiteSettingsInfo::PLATFORM_LINUX))
+ return nullptr;
+#elif defined(OS_MACOSX)
+ if (!(platform & WebsiteSettingsInfo::PLATFORM_MAC))
+ return nullptr;
+#elif defined(OS_CHROMEOS)
+ if (!(platform & WebsiteSettingsInfo::PLATFORM_CHROMEOS))
+ return nullptr;
+#elif defined(OS_ANDROID)
+ if (!(platform & WebsiteSettingsInfo::PLATFORM_ANDROID))
+ return nullptr;
+#elif defined(OS_IOS)
msramek 2016/05/23 14:49:49 I read the failing test outputs, and I currently s
lshang 2016/05/24 11:55:46 I added some LOGs and found out that on ios-simula
msramek 2016/05/24 14:29:23 Good to know! Maybe you want to share this on the
+ if ((platform & WebsiteSettingsInfo::PLATFORM_IOS) == 0)
+ return nullptr;
+#endif
+std::cout << "+++++++++registered++++++++" << std::endl;
WebsiteSettingsInfo* info = new WebsiteSettingsInfo(
type, name, std::move(initial_default_value), sync_status, lossy_status,
scoping_type, incognito_behavior);
@@ -88,23 +115,28 @@ void WebsiteSettingsRegistry::Init() {
"auto-select-certificate", nullptr, WebsiteSettingsInfo::UNSYNCABLE,
WebsiteSettingsInfo::NOT_LOSSY,
WebsiteSettingsInfo::REQUESTING_DOMAIN_ONLY_SCOPE,
+ WebsiteSettingsInfo::ALL_PLATFORMS,
WebsiteSettingsInfo::INHERIT_IN_INCOGNITO);
Register(CONTENT_SETTINGS_TYPE_SSL_CERT_DECISIONS, "ssl-cert-decisions",
nullptr, WebsiteSettingsInfo::UNSYNCABLE,
WebsiteSettingsInfo::NOT_LOSSY,
WebsiteSettingsInfo::REQUESTING_ORIGIN_ONLY_SCOPE,
+ WebsiteSettingsInfo::DESKTOP | WebsiteSettingsInfo::PLATFORM_ANDROID,
WebsiteSettingsInfo::INHERIT_IN_INCOGNITO);
Register(CONTENT_SETTINGS_TYPE_APP_BANNER, "app-banner", nullptr,
WebsiteSettingsInfo::UNSYNCABLE, WebsiteSettingsInfo::LOSSY,
WebsiteSettingsInfo::REQUESTING_DOMAIN_ONLY_SCOPE,
+ WebsiteSettingsInfo::DESKTOP | WebsiteSettingsInfo::PLATFORM_ANDROID,
WebsiteSettingsInfo::INHERIT_IN_INCOGNITO);
Register(CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT, "site-engagement", nullptr,
WebsiteSettingsInfo::UNSYNCABLE, WebsiteSettingsInfo::LOSSY,
WebsiteSettingsInfo::REQUESTING_ORIGIN_ONLY_SCOPE,
+ WebsiteSettingsInfo::DESKTOP | WebsiteSettingsInfo::PLATFORM_ANDROID,
WebsiteSettingsInfo::INHERIT_IN_INCOGNITO);
Register(CONTENT_SETTINGS_TYPE_USB_CHOOSER_DATA, "usb-chooser-data", nullptr,
WebsiteSettingsInfo::UNSYNCABLE, WebsiteSettingsInfo::NOT_LOSSY,
WebsiteSettingsInfo::REQUESTING_ORIGIN_AND_TOP_LEVEL_ORIGIN_SCOPE,
+ WebsiteSettingsInfo::DESKTOP | WebsiteSettingsInfo::PLATFORM_ANDROID,
WebsiteSettingsInfo::DONT_INHERIT_IN_INCOGNITO);
}

Powered by Google App Engine
This is Rietveld 408576698