| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 UI_AURA_SHELL_SHELL_H_ | 5 #ifndef UI_AURA_SHELL_SHELL_H_ |
| 6 #define UI_AURA_SHELL_SHELL_H_ | 6 #define UI_AURA_SHELL_SHELL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 class Window; | 21 class Window; |
| 22 } | 22 } |
| 23 namespace gfx { | 23 namespace gfx { |
| 24 class Rect; | 24 class Rect; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace aura_shell { | 27 namespace aura_shell { |
| 28 | 28 |
| 29 class Launcher; | 29 class Launcher; |
| 30 class ShellDelegate; | 30 class ShellDelegate; |
| 31 class WorkspaceManager; |
| 31 | 32 |
| 32 // Shell is a singleton object that presents the Shell API and implements the | 33 // Shell is a singleton object that presents the Shell API and implements the |
| 33 // Desktop's delegate interface. | 34 // Desktop's delegate interface. |
| 34 class AURA_SHELL_EXPORT Shell : public aura::DesktopDelegate { | 35 class AURA_SHELL_EXPORT Shell : public aura::DesktopDelegate { |
| 35 public: | 36 public: |
| 36 // Upon creation, the Shell sets itself as the Desktop's delegate, which takes | 37 // Upon creation, the Shell sets itself as the Desktop's delegate, which takes |
| 37 // ownership of the Shell. | 38 // ownership of the Shell. |
| 38 Shell(); | 39 Shell(); |
| 39 virtual ~Shell(); | 40 virtual ~Shell(); |
| 40 | 41 |
| 41 static Shell* GetInstance(); | 42 static Shell* GetInstance(); |
| 42 | 43 |
| 43 void Init(); | 44 void Init(); |
| 44 | 45 |
| 45 // Sets the delegate. Shell owns its delegate. | 46 // Sets the delegate. Shell owns its delegate. |
| 46 void SetDelegate(ShellDelegate* delegate); | 47 void SetDelegate(ShellDelegate* delegate); |
| 47 ShellDelegate* delegate() { return delegate_.get(); } | 48 ShellDelegate* delegate() { return delegate_.get(); } |
| 48 | 49 |
| 49 aura::Window* GetContainer(int container_id); | 50 aura::Window* GetContainer(int container_id); |
| 50 const aura::Window* GetContainer(int container_id) const; | 51 const aura::Window* GetContainer(int container_id) const; |
| 51 | 52 |
| 52 void TileWindows(); | 53 // Toggles between overview mode and normal mode. |
| 53 void RestoreTiledWindows(); | 54 void ToggleOverview(); |
| 54 | 55 |
| 55 Launcher* launcher() { return launcher_.get(); } | 56 Launcher* launcher() { return launcher_.get(); } |
| 56 | 57 |
| 57 private: | 58 private: |
| 58 typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair; | 59 typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair; |
| 59 | 60 |
| 60 // Overridden from aura::DesktopDelegate: | 61 // Overridden from aura::DesktopDelegate: |
| 61 virtual void AddChildToDefaultParent(aura::Window* window) OVERRIDE; | 62 virtual void AddChildToDefaultParent(aura::Window* window) OVERRIDE; |
| 62 virtual aura::Window* GetTopmostWindowToActivate( | 63 virtual aura::Window* GetTopmostWindowToActivate( |
| 63 aura::Window* ignore) const OVERRIDE; | 64 aura::Window* ignore) const OVERRIDE; |
| 64 | 65 |
| 65 static Shell* instance_; | 66 static Shell* instance_; |
| 66 | 67 |
| 67 std::vector<WindowAndBoundsPair> to_restore_; | 68 std::vector<WindowAndBoundsPair> to_restore_; |
| 68 | 69 |
| 69 base::WeakPtrFactory<Shell> method_factory_; | 70 base::WeakPtrFactory<Shell> method_factory_; |
| 70 | 71 |
| 71 scoped_ptr<ShellDelegate> delegate_; | 72 scoped_ptr<ShellDelegate> delegate_; |
| 72 | 73 |
| 73 scoped_ptr<Launcher> launcher_; | 74 scoped_ptr<Launcher> launcher_; |
| 74 | 75 |
| 76 scoped_ptr<WorkspaceManager> workspace_manager_; |
| 77 |
| 75 DISALLOW_COPY_AND_ASSIGN(Shell); | 78 DISALLOW_COPY_AND_ASSIGN(Shell); |
| 76 }; | 79 }; |
| 77 | 80 |
| 78 } // namespace aura_shell | 81 } // namespace aura_shell |
| 79 | 82 |
| 80 #endif // UI_AURA_SHELL_SHELL_H_ | 83 #endif // UI_AURA_SHELL_SHELL_H_ |
| OLD | NEW |