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/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc
index ed1ebc8..8f2508f2 100644
--- a/chrome/browser/ui/browser_command_controller.cc
+++ b/chrome/browser/ui/browser_command_controller.cc
@@ -95,6 +95,7 @@
 #endif
 
 #if defined(USE_OZONE)
+#include "ui/base/ui_base_features.h"
 #include "ui/ozone/public/ozone_platform.h"
 #endif
 
@@ -961,9 +962,11 @@
   command_updater_.UpdateCommandEnabled(IDC_RESTORE_WINDOW, true);
   bool use_system_title_bar = true;
 #if defined(USE_OZONE)
-  use_system_title_bar = ui::OzonePlatform::GetInstance()
-                             ->GetPlatformProperties()
-                             .use_system_title_bar;
+  if (features::IsUsingOzonePlatform()) {
+    use_system_title_bar = ui::OzonePlatform::GetInstance()
+                               ->GetPlatformProperties()
+                               .use_system_title_bar;
+  }
 #endif
   command_updater_.UpdateCommandEnabled(IDC_USE_SYSTEM_TITLE_BAR,
                                         use_system_title_bar);