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

Unified Diff: chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc

Issue 2462423002: Condition the use of ChromeBrowserMainExtraPartsViewsLinux to !use_ozone (Closed)
Patch Set: addressed thomasanderson@ remarks Created 4 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc
diff --git a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc
index be7b34d69ae27012609f833d89fc3d6e28fa28bb..171d6dc517d559d20e51f89be96259bde6e55417 100644
--- a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc
+++ b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc
@@ -11,7 +11,9 @@
#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/themes/theme_service_factory.h"
#include "chrome/browser/ui/browser_list.h"
+#if !defined(USE_OZONE)
#include "chrome/browser/ui/libgtkui/gtk_ui.h"
+#endif
#include "chrome/browser/ui/simple_message_box.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/common/chrome_switches.h"
@@ -30,7 +32,9 @@
#include "ui/native_theme/native_theme_dark_aura.h"
#include "ui/views/linux_ui/linux_ui.h"
#include "ui/views/widget/desktop_aura/desktop_screen.h"
+#if defined(USE_X11)
Tom (Use chromium acct) 2016/11/01 18:10:07 nit: Please move the gtk_ui.h include and the x11_
tonikitoo 2016/11/01 18:29:54 Done.
#include "ui/views/widget/desktop_aura/x11_desktop_handler.h"
+#endif
#include "ui/views/widget/native_widget_aura.h"
namespace {
@@ -78,23 +82,34 @@ ChromeBrowserMainExtraPartsViewsLinux::
}
void ChromeBrowserMainExtraPartsViewsLinux::PreEarlyInitialization() {
+#if !defined(USE_OZONE)
// TODO(erg): Refactor this into a dlopen call when we add a GTK3 port.
views::LinuxUI* gtk2_ui = BuildGtk2UI();
gtk2_ui->SetNativeThemeOverride(base::Bind(&GetNativeThemeForWindow));
views::LinuxUI::SetInstance(gtk2_ui);
+#endif
}
void ChromeBrowserMainExtraPartsViewsLinux::ToolkitInitialized() {
ChromeBrowserMainExtraPartsViews::ToolkitInitialized();
+#if !defined(USE_OZONE)
views::LinuxUI::instance()->Initialize();
+#endif
}
void ChromeBrowserMainExtraPartsViewsLinux::PreCreateThreads() {
+ // Intentionally do not call the parent class' PreCreateThreads
Tom (Use chromium acct) 2016/11/01 18:10:06 Add the check for !defined(USE_OZONE) in ChromeBro
tonikitoo 2016/11/01 18:29:54 Done.
+ // here, given that it instantiates DesktopScreen, which is not
+ // used in Ozone.
+#if !defined(USE_OZONE)
ChromeBrowserMainExtraPartsViews::PreCreateThreads();
views::LinuxUI::instance()->UpdateDeviceScaleFactor(
display::Screen::GetScreen()->GetPrimaryDisplay().device_scale_factor());
+#endif
+#if defined(USE_X11)
views::X11DesktopHandler::get()->AddObserver(this);
+#endif
}
void ChromeBrowserMainExtraPartsViewsLinux::PreProfileInit() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698