X11 and Ozone: //chrome: choose code path with IsUsingOzonePlatform
This patch adds usage of ozone platform in //chrome.
It's not possible to use linux wrapper [1] for everything as it
may introduce circular deps and other problems. Plus, there
are many places that are guarded either by single USE_X11
or USE_OZONE. Thus, use the IsUsingOzonePlatform feature
flag to choose the correct path.
[1] https://crrev.com/c/2250106
-----
Please note that this ugliness is added temporarily and
will be removed as soon as use_x11 is removed (hopefully
by Q1 2021 depending on how the finch trial goes).
Please also note that it's impossible to build use_x11 && use_ozone
without some hacks in PlatformCursor code. The changes to that are
on their way to upstream.
----
Bug: 1085700
Change-Id: I01653d42a448e708bc772ac2ec4aa64dd3f178b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2250066
Commit-Queue: Maksim Sisov <[email protected]>
Reviewed-by: Robert Kroeger <[email protected]>
Reviewed-by: Scott Violet <[email protected]>
Reviewed-by: Thomas Anderson <[email protected]>
Cr-Commit-Position: refs/heads/master@{#780730}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index a080d76..3b824f38 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -401,6 +401,10 @@
#include "chrome/browser/media/feeds/media_feeds_service.h"
#endif
+#if defined(USE_X11)
+#include "ui/base/ui_base_features.h"
+#endif
+
namespace {
#if defined(OS_ANDROID)
@@ -617,7 +621,8 @@
registry->RegisterStringPref(kLastKnownGoogleURL, std::string());
registry->RegisterStringPref(kLastPromptedGoogleURL, std::string());
#if defined(USE_X11)
- registry->RegisterIntegerPref(kLocalProfileId, 0);
+ if (!features::IsUsingOzonePlatform())
+ registry->RegisterIntegerPref(kLocalProfileId, 0);
#endif
registry->RegisterBooleanPref(kInsecureExtensionUpdatesEnabled, false);
@@ -1246,7 +1251,8 @@
// Added 7/2019.
#if defined(USE_X11)
- profile_prefs->ClearPref(kLocalProfileId);
+ if (!features::IsUsingOzonePlatform())
+ profile_prefs->ClearPref(kLocalProfileId);
#endif
// Added 8/2019