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

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 more of thomasanderson@ remakrs 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..139c78453df2e4f37d26e2751437a3db8fd56c1d 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,6 @@
#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/themes/theme_service_factory.h"
#include "chrome/browser/ui/browser_list.h"
-#include "chrome/browser/ui/libgtkui/gtk_ui.h"
#include "chrome/browser/ui/simple_message_box.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/common/chrome_switches.h"
@@ -30,9 +29,16 @@
#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"
-#include "ui/views/widget/desktop_aura/x11_desktop_handler.h"
#include "ui/views/widget/native_widget_aura.h"
+#if !defined(USE_OZONE)
+#include "chrome/browser/ui/libgtkui/gtk_ui.h"
+#endif
+
+#if defined(USE_X11)
+#include "ui/views/widget/desktop_aura/x11_desktop_handler.h"
+#endif
+
namespace {
ui::NativeTheme* GetNativeThemeForWindow(aura::Window* window) {
Lei Zhang 2016/11/01 21:36:25 Is the Ozone build going to complain that this is
@@ -72,29 +78,39 @@ ChromeBrowserMainExtraPartsViewsLinux::ChromeBrowserMainExtraPartsViewsLinux() {
ChromeBrowserMainExtraPartsViewsLinux::
~ChromeBrowserMainExtraPartsViewsLinux() {
+#if defined(USE_X11)
// X11DesktopHandler is destructed at this point, so we don't need to remove
// ourselves as an X11DesktopHandlerObserver
DCHECK(!aura::Env::GetInstanceDontCreate());
+#endif
}
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() {
ChromeBrowserMainExtraPartsViews::PreCreateThreads();
+#if !defined(USE_OZONE)
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