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

Unified Diff: ash/mus/window_manager.h

Issue 2302673002: mash: Avoid shelf crashes on display removal. (Closed)
Patch Set: minor cleanup. Created 4 years, 3 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: ash/mus/window_manager.h
diff --git a/ash/mus/window_manager.h b/ash/mus/window_manager.h
index 67ea7ca4d048a0f56241c4f3e56616ca6825be8d..d10f5acd67ad0bc799100dd54710ac122c2ab5e7 100644
--- a/ash/mus/window_manager.h
+++ b/ash/mus/window_manager.h
@@ -12,15 +12,17 @@
#include "base/macros.h"
#include "base/observer_list.h"
+#include "mojo/public/cpp/bindings/binding.h"
#include "services/ui/common/types.h"
#include "services/ui/public/cpp/window_manager_delegate.h"
#include "services/ui/public/cpp/window_observer.h"
#include "services/ui/public/cpp/window_tree_client_delegate.h"
+#include "services/ui/public/interfaces/display.mojom.h"
#include "services/ui/public/interfaces/window_manager.mojom.h"
namespace display {
class Display;
-class Screen;
+class ScreenBase;
}
namespace shell {
@@ -48,7 +50,8 @@ class WmTestHelper;
// the WindowTreeClient.
class WindowManager : public ui::WindowManagerDelegate,
public ui::WindowObserver,
- public ui::WindowTreeClientDelegate {
+ public ui::WindowTreeClientDelegate,
+ public ui::mojom::DisplayManagerObserver {
public:
explicit WindowManager(shell::Connector* connector);
~WindowManager() override;
@@ -121,6 +124,12 @@ class WindowManager : public ui::WindowManagerDelegate,
ui::mojom::EventResult OnAccelerator(uint32_t id,
const ui::Event& event) override;
+ // ui::mojom::DisplayManager:
+ void OnDisplays(mojo::Array<ui::mojom::WsDisplayPtr> ws_displays) override;
+ void OnDisplaysChanged(
+ mojo::Array<ui::mojom::WsDisplayPtr> ws_displays) override;
+ void OnDisplayRemoved(int64_t id) override;
+
shell::Connector* connector_;
ui::WindowTreeClient* window_tree_client_ = nullptr;
@@ -136,7 +145,9 @@ class WindowManager : public ui::WindowManagerDelegate,
base::ObserverList<WindowManagerObserver> observers_;
- std::unique_ptr<display::Screen> screen_;
+ std::unique_ptr<display::ScreenBase> screen_;
+ mojo::Binding<ui::mojom::DisplayManagerObserver>
+ display_manager_observer_binding_;
std::unique_ptr<WmShellMus> shell_;

Powered by Google App Engine
This is Rietveld 408576698