Let content_shell initialize GTK on Linux
This lets content_shell get the same font setting as Chrome.
Especially this lets features like LCD-text work in content_shell on
Linux, allowing us to debug the feature in content_shell.
Change-Id: I0b02018c4cc11ef360dd0a0df0ec9cc901835a33
Bug: 1077553
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2176984
Commit-Queue: Xianzhu Wang <[email protected]>
Reviewed-by: Peter Beverloo <[email protected]>
Reviewed-by: Thomas Anderson <[email protected]>
Cr-Commit-Position: refs/heads/master@{#766044}
diff --git a/content/shell/browser/shell_browser_main_parts.h b/content/shell/browser/shell_browser_main_parts.h
index 17ed638a..87c5f47 100644
--- a/content/shell/browser/shell_browser_main_parts.h
+++ b/content/shell/browser/shell_browser_main_parts.h
@@ -13,6 +13,13 @@
#include "content/public/browser/browser_main_parts.h"
#include "content/public/common/main_function_params.h"
#include "content/shell/browser/shell_browser_context.h"
+#include "ui/base/buildflags.h"
+
+#if BUILDFLAG(USE_GTK)
+namespace ui {
+class GtkUiDelegate;
+}
+#endif
namespace content {
@@ -26,6 +33,7 @@
int PreCreateThreads() override;
void PreMainMessageLoopStart() override;
void PostMainMessageLoopStart() override;
+ void ToolkitInitialized() override;
void PreMainMessageLoopRun() override;
bool MainMessageLoopRun(int* result_code) override;
void PreDefaultMainMessageLoopRun(base::OnceClosure quit_closure) override;
@@ -57,6 +65,10 @@
const MainFunctionParams parameters_;
bool run_message_loop_;
+#if BUILDFLAG(USE_GTK)
+ std::unique_ptr<ui::GtkUiDelegate> gtk_ui_delegate_;
+#endif
+
DISALLOW_COPY_AND_ASSIGN(ShellBrowserMainParts);
};