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

Unified Diff: ash/common/wm_root_window_controller.h

Issue 2620153003: Folds WmRootWindowController into RootWindowController (Closed)
Patch Set: merge 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/common/wm_root_window_controller.h
diff --git a/ash/common/wm_root_window_controller.h b/ash/common/wm_root_window_controller.h
deleted file mode 100644
index 15e811cbd129b3b2fd47674c659fbf5e255d80b5..0000000000000000000000000000000000000000
--- a/ash/common/wm_root_window_controller.h
+++ /dev/null
@@ -1,202 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef ASH_COMMON_WM_ROOT_WINDOW_CONTROLLER_H_
-#define ASH_COMMON_WM_ROOT_WINDOW_CONTROLLER_H_
-
-#include "ash/ash_export.h"
-#include "ash/common/wm/workspace/workspace_types.h"
-#include "base/macros.h"
-#include "ui/base/ui_base_types.h"
-#include "ui/views/widget/widget.h"
-
-namespace gfx {
-class Point;
-}
-
-namespace ui {
-class MenuModel;
-}
-
-namespace views {
-class MenuModelAdapter;
-class MenuRunner;
-}
-
-namespace ash {
-
-class AlwaysOnTopController;
-class AnimatingWallpaperWidgetController;
-class DockedWindowLayoutManager;
-class PanelLayoutManager;
-class RootWindowController;
-class SystemModalContainerLayoutManager;
-class SystemTray;
-class WallpaperWidgetController;
-class WmShelf;
-class WmWindow;
-class WorkspaceController;
-
-enum class LoginStatus;
-
-namespace wm {
-class RootWindowLayoutManager;
-}
-
-// Provides state associated with a root of a window hierarchy.
-class ASH_EXPORT WmRootWindowController {
- public:
- WmRootWindowController(RootWindowController* root_window_controller,
- WmWindow* window);
- ~WmRootWindowController();
-
- DockedWindowLayoutManager* docked_window_layout_manager() {
- return docked_window_layout_manager_;
- }
-
- PanelLayoutManager* panel_layout_manager() { return panel_layout_manager_; }
-
- wm::RootWindowLayoutManager* root_window_layout_manager() {
- return root_window_layout_manager_;
- }
-
- WallpaperWidgetController* wallpaper_widget_controller() {
- return wallpaper_widget_controller_.get();
- }
- void SetWallpaperWidgetController(WallpaperWidgetController* controller);
-
- AnimatingWallpaperWidgetController* animating_wallpaper_widget_controller() {
- return animating_wallpaper_widget_controller_.get();
- }
- void SetAnimatingWallpaperWidgetController(
- AnimatingWallpaperWidgetController* controller);
-
- WorkspaceController* workspace_controller() {
- return workspace_controller_.get();
- }
-
- AlwaysOnTopController* always_on_top_controller() {
- return always_on_top_controller_.get();
- }
-
- wm::WorkspaceWindowState GetWorkspaceWindowState();
-
- // Returns the layout manager for the appropriate modal-container. If the
- // window is inside the lockscreen modal container, then the layout manager
- // for that is returned. Otherwise the layout manager for the default modal
- // container is returned.
- // If no window is specified (i.e. |window| is null), then the lockscreen
- // modal container is used if the screen is currently locked. Otherwise, the
- // default modal container is used.
- SystemModalContainerLayoutManager* GetSystemModalLayoutManager(
- WmWindow* window);
-
- bool HasShelf();
-
- WmShelf* GetShelf();
-
- // Creates the shelf for this root window and notifies observers.
- void CreateShelf();
-
- // Show shelf view if it was created hidden (before session has started).
- // TODO(jamescook): Eliminate this and handle show via Shelf.
- void ShowShelf();
-
- // Returns the system tray controller. May be null for external displays.
- SystemTray* GetSystemTray();
-
- // Returns the window associated with this WmRootWindowController.
- WmWindow* GetWindow();
-
- // Gets the WmWindow whose shell window id is |container_id|.
- WmWindow* GetContainer(int container_id);
- const WmWindow* GetContainer(int container_id) const;
-
- // Configures |init_params| prior to initializing |widget|.
- // |shell_container_id| is the id of the container to parent |widget| to.
- void ConfigureWidgetInitParamsForContainer(
- views::Widget* widget,
- int shell_container_id,
- views::Widget::InitParams* init_params);
-
- // Returns the window events will be targeted at for the specified location
- // (in screen coordinates).
- //
- // NOTE: the returned window may not contain the location as resize handles
- // may extend outside the bounds of the window.
- WmWindow* FindEventTarget(const gfx::Point& location_in_screen);
-
- // Gets the last location seen in a mouse event in this root window's
- // coordinates. This may return a point outside the root window's bounds.
- gfx::Point GetLastMouseLocationInRoot();
-
- // Shows a context menu at the |location_in_screen|.
- void ShowContextMenu(const gfx::Point& location_in_screen,
- ui::MenuSourceType source_type);
-
- // Called when the wallpaper animation has started or finished.
- // TODO: port remaining classic ash wallpaper functionality here.
- void OnInitialWallpaperAnimationStarted();
- void OnWallpaperAnimationFinished(views::Widget* widget);
-
- // Called when the login status changes after login (such as lock/unlock).
- // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|.
- virtual void UpdateAfterLoginStatusChange(LoginStatus status);
-
- protected:
- // Moves child windows to |dest|.
- void MoveWindowsTo(WmWindow* dest);
-
- // Creates the containers (WmWindows) used by the shell.
- void CreateContainers();
-
- // Creates the LayoutManagers for the windows created by CreateContainers().
- void CreateLayoutManagers();
-
- // Resets WmShell::GetRootWindowForNewWindows() if appropriate. This is called
- // during shutdown to make sure GetRootWindowForNewWindows() isn't referencing
- // this.
- void ResetRootForNewWindowsIfNecessary();
-
- // Called during shutdown to destroy state such as windows and LayoutManagers.
- void CloseChildWindows();
-
- private:
- friend class RootWindowController;
-
- // Called from CloseChildWindows() to determine if the specified window should
- // be destroyed.
- bool ShouldDestroyWindowInCloseChildWindows(WmWindow* window);
-
- // Callback for MenuModelAdapter.
- void OnMenuClosed();
-
- // TODO(sky): remove this, needed until merge two classes.
- RootWindowController* root_window_controller_;
-
- WmWindow* root_;
-
- // LayoutManagers are owned by the window they are installed on.
- DockedWindowLayoutManager* docked_window_layout_manager_ = nullptr;
- PanelLayoutManager* panel_layout_manager_ = nullptr;
- wm::RootWindowLayoutManager* root_window_layout_manager_ = nullptr;
-
- std::unique_ptr<WallpaperWidgetController> wallpaper_widget_controller_;
- std::unique_ptr<AnimatingWallpaperWidgetController>
- animating_wallpaper_widget_controller_;
- std::unique_ptr<WorkspaceController> workspace_controller_;
-
- std::unique_ptr<AlwaysOnTopController> always_on_top_controller_;
-
- // Manages the context menu.
- std::unique_ptr<ui::MenuModel> menu_model_;
- std::unique_ptr<views::MenuModelAdapter> menu_model_adapter_;
- std::unique_ptr<views::MenuRunner> menu_runner_;
-
- DISALLOW_COPY_AND_ASSIGN(WmRootWindowController);
-};
-
-} // namespace ash
-
-#endif // ASH_COMMON_WM_ROOT_WINDOW_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698