| 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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 | 10 |
| 11 class SkBitmap; | 11 class SkBitmap; |
| 12 | 12 |
| 13 namespace aura { | 13 namespace aura { |
| 14 class EventFilter; | 14 class EventFilter; |
| 15 class RootWindow; | 15 class RootWindow; |
| 16 class Window; | 16 class Window; |
| 17 namespace shared { | 17 namespace shared { |
| 18 class InputMethodEventFilter; | 18 class InputMethodEventFilter; |
| 19 class RootWindowEventFilter; | 19 class RootWindowEventFilter; |
| 20 } // namespace shared | 20 } // namespace shared |
| 21 } // namespace aura | 21 } // namespace aura |
| 22 | 22 |
| 23 namespace ash { | 23 namespace ash { |
| 24 class ToplevelWindowEventHandler; | 24 class ToplevelWindowEventHandler; |
| 25 namespace internal { | 25 namespace internal { |
| 26 | 26 |
| 27 class EventClientImpl; | 27 class EventClientImpl; |
| 28 class RootWindowLayoutManager; | 28 class RootWindowLayoutManager; |
| 29 class ScreenDimmer; | 29 class ScreenDimmer; |
| 30 class SystemBackgroundController; |
| 30 class WorkspaceController; | 31 class WorkspaceController; |
| 31 | 32 |
| 32 // This class maintains the per root window state for ash. This class | 33 // This class maintains the per root window state for ash. This class |
| 33 // owns the root window and other dependent objects that should be | 34 // owns the root window and other dependent objects that should be |
| 34 // deleted upon the deletion of the root window. The RootWindowController | 35 // deleted upon the deletion of the root window. The RootWindowController |
| 35 // for particular root window is stored as a property and can be obtained | 36 // for particular root window is stored as a property and can be obtained |
| 36 // using |GetRootWindowController(aura::RootWindow*)| function. | 37 // using |GetRootWindowController(aura::RootWindow*)| function. |
| 37 class RootWindowController { | 38 class RootWindowController { |
| 38 public: | 39 public: |
| 39 explicit RootWindowController(aura::RootWindow* root_window); | 40 explicit RootWindowController(aura::RootWindow* root_window); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 50 internal::WorkspaceController* workspace_controller() { | 51 internal::WorkspaceController* workspace_controller() { |
| 51 return workspace_controller_.get(); | 52 return workspace_controller_.get(); |
| 52 } | 53 } |
| 53 | 54 |
| 54 internal::ScreenDimmer* screen_dimmer() { | 55 internal::ScreenDimmer* screen_dimmer() { |
| 55 return screen_dimmer_.get(); | 56 return screen_dimmer_.get(); |
| 56 } | 57 } |
| 57 | 58 |
| 58 aura::Window* GetContainer(int container_id); | 59 aura::Window* GetContainer(int container_id); |
| 59 | 60 |
| 61 void InitLayoutManagers(); |
| 60 void CreateContainers(); | 62 void CreateContainers(); |
| 61 void InitLayoutManagers(); | 63 |
| 64 // Initializes |background_|. |is_first_run_after_boot| determines the |
| 65 // background's initial color. |
| 66 void CreateSystemBackground(bool is_first_run_after_boot); |
| 67 |
| 68 // Updates |background_| to be black after the desktop background is visible. |
| 69 void HandleDesktopBackgroundVisible(); |
| 62 | 70 |
| 63 // Deletes associated objects and clears the state, but doesn't delete | 71 // Deletes associated objects and clears the state, but doesn't delete |
| 64 // the root window yet. This is used to delete a secondary displays' | 72 // the root window yet. This is used to delete a secondary displays' |
| 65 // root window safely when the display disconnect signal is received, | 73 // root window safely when the display disconnect signal is received, |
| 66 // which may come while we're in the nested message loop. | 74 // which may come while we're in the nested message loop. |
| 67 void Shutdown(); | 75 void Shutdown(); |
| 68 | 76 |
| 69 // Deletes all child windows and performs necessary cleanup. | 77 // Deletes all child windows and performs necessary cleanup. |
| 70 void CloseChildWindows(); | 78 void CloseChildWindows(); |
| 71 | 79 |
| 72 // Returns true if the workspace has a maximized or fullscreen window. | 80 // Returns true if the workspace has a maximized or fullscreen window. |
| 73 bool IsInMaximizedMode() const; | 81 bool IsInMaximizedMode() const; |
| 74 | 82 |
| 75 // Moves child windows to |dest|. | 83 // Moves child windows to |dest|. |
| 76 void MoveWindowsTo(aura::RootWindow* dest); | 84 void MoveWindowsTo(aura::RootWindow* dest); |
| 77 | 85 |
| 78 private: | 86 private: |
| 79 // Creates each of the special window containers that holds windows of various | 87 // Creates each of the special window containers that holds windows of various |
| 80 // types in the shell UI. | 88 // types in the shell UI. |
| 81 void CreateContainersInRootWindow(aura::RootWindow* root_window); | 89 void CreateContainersInRootWindow(aura::RootWindow* root_window); |
| 82 | 90 |
| 83 scoped_ptr<aura::RootWindow> root_window_; | 91 scoped_ptr<aura::RootWindow> root_window_; |
| 84 internal::RootWindowLayoutManager* root_window_layout_; | 92 internal::RootWindowLayoutManager* root_window_layout_; |
| 85 | 93 |
| 94 // A background layer that's displayed beneath all other layers. Without |
| 95 // this, portions of the root window that aren't covered by layers will be |
| 96 // painted white; this can show up if e.g. it takes a long time to decode the |
| 97 // desktop background image when displaying the login screen. |
| 98 scoped_ptr<SystemBackgroundController> background_; |
| 99 |
| 86 // An event filter that pre-handles all key events to send them to an IME. | 100 // An event filter that pre-handles all key events to send them to an IME. |
| 87 scoped_ptr<internal::EventClientImpl> event_client_; | 101 scoped_ptr<internal::EventClientImpl> event_client_; |
| 88 scoped_ptr<internal::ScreenDimmer> screen_dimmer_; | 102 scoped_ptr<internal::ScreenDimmer> screen_dimmer_; |
| 89 scoped_ptr<internal::WorkspaceController> workspace_controller_; | 103 scoped_ptr<internal::WorkspaceController> workspace_controller_; |
| 90 | 104 |
| 91 // We need to own event handlers for various containers. | 105 // We need to own event handlers for various containers. |
| 92 scoped_ptr<ToplevelWindowEventHandler> default_container_handler_; | 106 scoped_ptr<ToplevelWindowEventHandler> default_container_handler_; |
| 93 scoped_ptr<ToplevelWindowEventHandler> always_on_top_container_handler_; | 107 scoped_ptr<ToplevelWindowEventHandler> always_on_top_container_handler_; |
| 94 scoped_ptr<ToplevelWindowEventHandler> modal_container_handler_; | 108 scoped_ptr<ToplevelWindowEventHandler> modal_container_handler_; |
| 95 scoped_ptr<ToplevelWindowEventHandler> lock_modal_container_handler_; | 109 scoped_ptr<ToplevelWindowEventHandler> lock_modal_container_handler_; |
| 96 | 110 |
| 97 DISALLOW_COPY_AND_ASSIGN(RootWindowController); | 111 DISALLOW_COPY_AND_ASSIGN(RootWindowController); |
| 98 }; | 112 }; |
| 99 | 113 |
| 100 } // namespace internal | 114 } // namespace internal |
| 101 } // ash | 115 } // ash |
| 102 | 116 |
| 103 #endif // ASH_ROOT_WINDOW_CONTROLLER_H_ | 117 #endif // ASH_ROOT_WINDOW_CONTROLLER_H_ |
| OLD | NEW |