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

Unified Diff: ash/root_window_controller.h

Issue 2620913003: Removes WmRootWindowController subclasses (Closed)
Patch Set: WmLookupAura::GetRootWindowControllerWithDisplayId needs to handle null Created 3 years, 11 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/root_window_controller.h
diff --git a/ash/root_window_controller.h b/ash/root_window_controller.h
index 1fe197d31a1925b89201144bd34064834e60b111..dc980753f352ac326c34b4a56425e0deb647a321 100644
--- a/ash/root_window_controller.h
+++ b/ash/root_window_controller.h
@@ -29,6 +29,7 @@ class KeyboardController;
namespace ui {
class EventHandler;
+class WindowTreeHost;
}
namespace views {
@@ -53,10 +54,14 @@ class SystemTray;
class SystemWallpaperController;
class TouchHudDebug;
class TouchHudProjection;
-class WmRootWindowControllerAura;
+class WmRootWindowController;
class WmShelf;
class WorkspaceController;
+namespace mus {
+class RootWindowController;
+}
+
// This class maintains the per root window state for ash. This class
// owns the root window and other dependent objects that should be
// deleted upon the deletion of the root window. This object is
@@ -64,12 +69,12 @@ class WorkspaceController;
// The RootWindowController for particular root window is stored in
// its property (RootWindowSettings) and can be obtained using
// |GetRootWindowController(aura::WindowEventDispatcher*)| function.
-//
-// NOTE: In classic ash there is one RootWindow per display, so every RootWindow
-// has a RootWindowController. In mus/mash there is one RootWindow per top-level
-// Widget, so not all RootWindows have a RootWindowController.
class ASH_EXPORT RootWindowController : public ShellObserver {
public:
+ enum class RootWindowType { PRIMARY, SECONDARY };
James Cook 2017/01/10 22:41:14 nit: not your fault, but please document. Does SEC
sky 2017/01/10 23:06:56 Yes. Added comment.
+
+ ~RootWindowController() override;
+
// Creates and Initialize the RootWindowController for primary display.
static void CreateForPrimaryDisplay(AshWindowTreeHost* host);
@@ -82,8 +87,8 @@ class ASH_EXPORT RootWindowController : public ShellObserver {
// Returns the RootWindowController of the target root window.
static RootWindowController* ForTargetRootWindow();
- ~RootWindowController() override;
-
+ // TODO(sky): move these to a separate class or use AshWindowTreeHost in
+ // mash. http://crbug.com/671246.
AshWindowTreeHost* ash_host() { return ash_host_.get(); }
const AshWindowTreeHost* ash_host() const { return ash_host_.get(); }
@@ -96,8 +101,8 @@ class ASH_EXPORT RootWindowController : public ShellObserver {
WmShelf* wm_shelf() const { return wm_shelf_.get(); }
- WmRootWindowControllerAura* wm_root_window_controller() {
- return wm_root_window_controller_;
+ WmRootWindowController* wm_root_window_controller() {
+ return wm_root_window_controller_.get();
}
// Get touch HUDs associated with this root window controller.
@@ -180,8 +185,16 @@ class ASH_EXPORT RootWindowController : public ShellObserver {
void SetTouchAccessibilityAnchorPoint(const gfx::Point& anchor_point);
private:
- explicit RootWindowController(AshWindowTreeHost* host);
- enum RootWindowType { PRIMARY, SECONDARY };
+ // TODO(sky): remove this. Temporary during ash-mus unification.
+ // http://crbug.com/671246.
+ friend class mus::RootWindowController;
+
+ // Creates a new RootWindowController with the specified host. Only one of
+ // |ash_host| or |window_tree_host| should be specified. This takes ownership
+ // of the supplied arguments.
+ // TODO(sky): mash should create AshWindowTreeHost, http://crbug.com/671246.
+ RootWindowController(AshWindowTreeHost* ash_host,
+ aura::WindowTreeHost* window_tree_host);
// Initializes the RootWindowController based on |root_window_type|.
void Init(RootWindowType root_window_type);
@@ -207,9 +220,11 @@ class ASH_EXPORT RootWindowController : public ShellObserver {
void OnTouchHudProjectionToggled(bool enabled) override;
std::unique_ptr<AshWindowTreeHost> ash_host_;
+ std::unique_ptr<aura::WindowTreeHost> owned_window_tree_host_;
James Cook 2017/01/10 22:41:14 should this be called aura_window_tree_host_ or mu
sky 2017/01/10 23:06:56 I went with mus_window_tree_host_.
+ // This comes from |ash_host_| or |owned_window_tree_host_|.
+ aura::WindowTreeHost* window_tree_host_;
- // Owned by the root window.
- WmRootWindowControllerAura* wm_root_window_controller_ = nullptr;
+ std::unique_ptr<WmRootWindowController> wm_root_window_controller_;
std::unique_ptr<StackingController> stacking_controller_;

Powered by Google App Engine
This is Rietveld 408576698