Index: ui/aura_shell/shell.h |
diff --git a/ui/aura_shell/shell.h b/ui/aura_shell/shell.h |
index 702142544c9c5773f49c014638d258fdc53ba2cc..79141ff1ca3176c7adb84d6382939df155a10a29 100644 |
--- a/ui/aura_shell/shell.h |
+++ b/ui/aura_shell/shell.h |
@@ -40,16 +40,13 @@ class AURA_SHELL_EXPORT Shell : public aura::StackingClient { |
public: |
// Upon creation, the Shell sets itself as the Desktop's delegate, which takes |
// ownership of the Shell. |
- Shell(); |
- virtual ~Shell(); |
- |
- static Shell* GetInstance(); |
- void Init(); |
+ // A shell must be explicitly created so that it can call |Init()| with the |
+ // delegate set. |delegate| can be NULL (if not required for initialization). |
+ static Shell* CreateInstance(ShellDelegate* delegate); |
- // Sets the delegate. Shell owns its delegate. |
- void SetDelegate(ShellDelegate* delegate); |
- ShellDelegate* delegate() { return delegate_.get(); } |
+ // Should never be called before |CreateInstance()|. |
+ static Shell* GetInstance(); |
aura::Window* GetContainer(int container_id); |
const aura::Window* GetContainer(int container_id) const; |
@@ -57,11 +54,17 @@ class AURA_SHELL_EXPORT Shell : public aura::StackingClient { |
// Toggles between overview mode and normal mode. |
void ToggleOverview(); |
+ ShellDelegate* delegate() { return delegate_.get(); } |
Launcher* launcher() { return launcher_.get(); } |
private: |
typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair; |
+ explicit Shell(ShellDelegate* delegate); |
+ virtual ~Shell(); |
+ |
+ void Init(); |
+ |
// Enables WorkspaceManager. |
void EnableWorkspaceManager(); |