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

Unified Diff: chrome/browser/chrome_browser_main_extra_parts_exo.cc

Issue 2250863003: exo: Run exo in mus+ash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix review issues Created 4 years, 4 months 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
Index: chrome/browser/chrome_browser_main_extra_parts_exo.cc
diff --git a/chrome/browser/chrome_browser_main_extra_parts_exo.cc b/chrome/browser/chrome_browser_main_extra_parts_exo.cc
index ee29d96126806cd0c65dc54b19fb4690cb4fdca1..33ef455be998b1610c2106f920cd2f7e481d0609 100644
--- a/chrome/browser/chrome_browser_main_extra_parts_exo.cc
+++ b/chrome/browser/chrome_browser_main_extra_parts_exo.cc
@@ -17,6 +17,8 @@
#include "chrome/common/chrome_switches.h"
#include "components/exo/display.h"
#include "components/exo/wayland/server.h"
+#include "components/exo/wm_helper_ash.h"
+#include "components/exo/wm_helper_mus.h"
#include "content/public/browser/browser_thread.h"
#include "ui/arc/notification/arc_notification_surface_manager.h"
@@ -110,25 +112,32 @@ class ChromeBrowserMainExtraPartsExo::WaylandWatcher
};
#endif
-ChromeBrowserMainExtraPartsExo::ChromeBrowserMainExtraPartsExo()
- : arc_notification_surface_manager_(new arc::ArcNotificationSurfaceManager),
- display_(new exo::Display(arc_notification_surface_manager_.get())) {}
+ChromeBrowserMainExtraPartsExo::ChromeBrowserMainExtraPartsExo() {}
ChromeBrowserMainExtraPartsExo::~ChromeBrowserMainExtraPartsExo() {}
void ChromeBrowserMainExtraPartsExo::PreProfileInit() {
- if (!chrome::ShouldOpenAshOnStartup())
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableWaylandServer))
return;
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableWaylandServer)) {
- wayland_server_ = exo::wayland::Server::Create(display_.get());
- wayland_watcher_ =
- base::WrapUnique(new WaylandWatcher(wayland_server_.get()));
- }
+ arc_notification_surface_manager_ =
+ base::MakeUnique<arc::ArcNotificationSurfaceManager>();
+ const bool using_mus = !chrome::ShouldOpenAshOnStartup();
+ if (using_mus)
+ wm_helper_ = base::MakeUnique<exo::WMHelperMus>();
+ else
+ wm_helper_ = base::MakeUnique<exo::WMHelperAsh>();
+ exo::WMHelper::SetInstance(wm_helper_.get());
+ display_ = base::MakeUnique<exo::Display>(
+ arc_notification_surface_manager_.get());
+ wayland_server_ = exo::wayland::Server::Create(display_.get());
+ wayland_watcher_ = base::MakeUnique<WaylandWatcher>(wayland_server_.get());
}
void ChromeBrowserMainExtraPartsExo::PostMainMessageLoopRun() {
wayland_watcher_.reset();
wayland_server_.reset();
+ exo::WMHelper::SetInstance(nullptr);
+ wm_helper_.reset();
}

Powered by Google App Engine
This is Rietveld 408576698