Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ASH_MUS_ROOT_WINDOW_CONTROLLER_H_ | |
| 6 #define ASH_MUS_ROOT_WINDOW_CONTROLLER_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "ash/root_window_controller.h" | |
| 11 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" | |
| 12 #include "ui/display/display.h" | |
| 13 | |
| 14 namespace aura { | |
| 15 class WindowTreeHostMus; | |
| 16 } | |
| 17 | |
| 18 namespace gfx { | |
| 19 class Insets; | |
| 20 } | |
| 21 | |
| 22 namespace service_manager { | |
| 23 class Connector; | |
| 24 } | |
| 25 | |
| 26 namespace ash { | |
| 27 | |
| 28 class WmWindow; | |
| 29 | |
| 30 namespace mus { | |
| 31 | |
| 32 class WindowManager; | |
| 33 class WmTestBase; | |
| 34 class WmTestHelper; | |
| 35 | |
| 36 // RootWindowController manages the windows and state for a single display. | |
| 37 // RootWindowController takes ownership of the WindowTreeHostMus that it passed | |
| 38 // to it. | |
| 39 // TODO(sky): rename this (or possibly just remove entirely). | |
| 40 // http://crbug.com/671246 | |
| 41 class RootWindowController { | |
| 42 public: | |
| 43 RootWindowController( | |
| 44 WindowManager* window_manager, | |
| 45 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host, | |
| 46 const display::Display& display, | |
| 47 ash::RootWindowController::RootWindowType root_window_type); | |
| 48 ~RootWindowController(); | |
| 49 | |
| 50 // Returns the RootWindowController for |window|'s root. | |
| 51 static RootWindowController* ForWindow(aura::Window* window); | |
| 52 | |
| 53 void Shutdown(); | |
| 54 | |
| 55 service_manager::Connector* GetConnector(); | |
| 56 | |
| 57 aura::Window* root(); | |
| 58 const aura::Window* root() const; | |
| 59 | |
| 60 aura::Window* NewTopLevelWindow( | |
| 61 ui::mojom::WindowType window_type, | |
| 62 std::map<std::string, std::vector<uint8_t>>* properties); | |
| 63 | |
| 64 WmWindow* GetWindowByShellWindowId(int id); | |
| 65 | |
| 66 void SetWorkAreaInests(const gfx::Insets& insets); | |
|
msw
2017/01/18 23:31:26
aside: goodbye, typo!
| |
| 67 void SetDisplay(const display::Display& display); | |
| 68 | |
| 69 WindowManager* window_manager() { return window_manager_; } | |
| 70 | |
| 71 aura::WindowTreeHostMus* window_tree_host() { return window_tree_host_; } | |
| 72 | |
| 73 const display::Display& display() const { return display_; } | |
| 74 | |
| 75 ash::RootWindowController* ash_root_window_controller() { | |
| 76 return ash_root_window_controller_.get(); | |
| 77 } | |
| 78 | |
| 79 private: | |
| 80 friend class WmTestBase; | |
| 81 friend class WmTestHelper; | |
| 82 | |
| 83 gfx::Rect CalculateDefaultBounds( | |
| 84 aura::Window* container_window, | |
| 85 const std::map<std::string, std::vector<uint8_t>>* properties) const; | |
| 86 gfx::Rect GetMaximizedWindowBounds() const; | |
| 87 | |
| 88 WindowManager* window_manager_; | |
| 89 std::unique_ptr<ash::RootWindowController> ash_root_window_controller_; | |
| 90 // Owned by |ash_root_window_controller_|. | |
| 91 aura::WindowTreeHostMus* window_tree_host_; | |
| 92 int window_count_ = 0; | |
| 93 | |
| 94 display::Display display_; | |
| 95 | |
| 96 DISALLOW_COPY_AND_ASSIGN(RootWindowController); | |
| 97 }; | |
| 98 | |
| 99 } // namespace mus | |
| 100 } // namespace ash | |
| 101 | |
| 102 #endif // ASH_MUS_ROOT_WINDOW_CONTROLLER_H_ | |
| OLD | NEW |