| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ASH_ROOT_WINDOW_CONTROLLER_H_ | 5 #ifndef ASH_ROOT_WINDOW_CONTROLLER_H_ |
| 6 #define ASH_ROOT_WINDOW_CONTROLLER_H_ | 6 #define ASH_ROOT_WINDOW_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> |
| 10 | 11 |
| 11 #include "ash/ash_export.h" | 12 #include "ash/ash_export.h" |
| 12 #include "ash/common/shell_observer.h" | 13 #include "ash/common/shell_observer.h" |
| 13 #include "ash/common/wm/workspace/workspace_types.h" | 14 #include "ash/common/wm/workspace/workspace_types.h" |
| 14 #include "ash/public/cpp/shelf_types.h" | 15 #include "ash/public/cpp/shelf_types.h" |
| 15 #include "base/macros.h" | 16 #include "base/macros.h" |
| 16 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
| 17 #include "ui/aura/window_tree_host.h" | 18 #include "ui/aura/window_tree_host.h" |
| 18 #include "ui/views/widget/widget.h" | 19 #include "ui/views/widget/widget.h" |
| 19 | 20 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 95 |
| 95 // Creates and Initialize the RootWindowController for secondary displays. | 96 // Creates and Initialize the RootWindowController for secondary displays. |
| 96 static void CreateForSecondaryDisplay(AshWindowTreeHost* host); | 97 static void CreateForSecondaryDisplay(AshWindowTreeHost* host); |
| 97 | 98 |
| 98 // Returns a RootWindowController of the window's root window. | 99 // Returns a RootWindowController of the window's root window. |
| 99 static RootWindowController* ForWindow(const aura::Window* window); | 100 static RootWindowController* ForWindow(const aura::Window* window); |
| 100 | 101 |
| 101 // Returns the RootWindowController of the target root window. | 102 // Returns the RootWindowController of the target root window. |
| 102 static RootWindowController* ForTargetRootWindow(); | 103 static RootWindowController* ForTargetRootWindow(); |
| 103 | 104 |
| 105 static std::vector<RootWindowController*> root_window_controllers() { |
| 106 return root_window_controllers_ ? *root_window_controllers_ |
| 107 : std::vector<RootWindowController*>(); |
| 108 } |
| 109 |
| 104 // Configures |init_params| prior to initializing |widget|. | 110 // Configures |init_params| prior to initializing |widget|. |
| 105 // |shell_container_id| is the id of the container to parent |widget| to. | 111 // |shell_container_id| is the id of the container to parent |widget| to. |
| 106 // TODO(sky): remove this, http://crbug.com/671246. | 112 // TODO(sky): remove this, http://crbug.com/671246. |
| 107 void ConfigureWidgetInitParamsForContainer( | 113 void ConfigureWidgetInitParamsForContainer( |
| 108 views::Widget* widget, | 114 views::Widget* widget, |
| 109 int shell_container_id, | 115 int shell_container_id, |
| 110 views::Widget::InitParams* init_params); | 116 views::Widget::InitParams* init_params); |
| 111 | 117 |
| 112 // TODO(sky): move these to a separate class or use AshWindowTreeHost in | 118 // TODO(sky): move these to a separate class or use AshWindowTreeHost in |
| 113 // mash. http://crbug.com/671246. | 119 // mash. http://crbug.com/671246. |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 // Heads-up displays for touch events. These HUDs are not owned by the root | 370 // Heads-up displays for touch events. These HUDs are not owned by the root |
| 365 // window controller and manage their own lifetimes. | 371 // window controller and manage their own lifetimes. |
| 366 TouchHudDebug* touch_hud_debug_ = nullptr; | 372 TouchHudDebug* touch_hud_debug_ = nullptr; |
| 367 TouchHudProjection* touch_hud_projection_ = nullptr; | 373 TouchHudProjection* touch_hud_projection_ = nullptr; |
| 368 | 374 |
| 369 // Handles double clicks on the panel window header. | 375 // Handles double clicks on the panel window header. |
| 370 std::unique_ptr<ui::EventHandler> panel_container_handler_; | 376 std::unique_ptr<ui::EventHandler> panel_container_handler_; |
| 371 | 377 |
| 372 std::unique_ptr<::wm::ScopedCaptureClient> capture_client_; | 378 std::unique_ptr<::wm::ScopedCaptureClient> capture_client_; |
| 373 | 379 |
| 380 static std::vector<RootWindowController*>* root_window_controllers_; |
| 381 |
| 374 DISALLOW_COPY_AND_ASSIGN(RootWindowController); | 382 DISALLOW_COPY_AND_ASSIGN(RootWindowController); |
| 375 }; | 383 }; |
| 376 | 384 |
| 377 // On classic ash, returns the RootWindowController for the given |root_window|. | 385 // On classic ash, returns the RootWindowController for the given |root_window|. |
| 378 // On mus ash, returns the RootWindowController for the primary display. | 386 // On mus ash, returns the RootWindowController for the primary display. |
| 379 // See RootWindowController class comment above. | 387 // See RootWindowController class comment above. |
| 380 ASH_EXPORT RootWindowController* GetRootWindowController( | 388 ASH_EXPORT RootWindowController* GetRootWindowController( |
| 381 const aura::Window* root_window); | 389 const aura::Window* root_window); |
| 382 | 390 |
| 383 } // namespace ash | 391 } // namespace ash |
| 384 | 392 |
| 385 #endif // ASH_ROOT_WINDOW_CONTROLLER_H_ | 393 #endif // ASH_ROOT_WINDOW_CONTROLLER_H_ |
| OLD | NEW |