| 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> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/task.h" | 14 #include "base/task.h" |
| 15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "ui/aura/desktop_delegate.h" | 17 #include "ui/aura/desktop_delegate.h" |
| 18 #include "ui/aura/drag_drop_controller.h" |
| 18 #include "ui/aura_shell/aura_shell_export.h" | 19 #include "ui/aura_shell/aura_shell_export.h" |
| 19 | 20 |
| 20 namespace aura { | 21 namespace aura { |
| 22 class MouseEvent; |
| 21 class Window; | 23 class Window; |
| 22 } | 24 } |
| 23 namespace gfx { | 25 namespace gfx { |
| 26 class Point; |
| 24 class Rect; | 27 class Rect; |
| 25 } | 28 } |
| 26 | 29 |
| 30 namespace ui { |
| 31 class OSExchangeData; |
| 32 } |
| 33 |
| 34 namespace views { |
| 35 class Widget; |
| 36 } |
| 37 |
| 27 namespace aura_shell { | 38 namespace aura_shell { |
| 28 | 39 |
| 29 class Launcher; | 40 class Launcher; |
| 30 class ShellDelegate; | 41 class ShellDelegate; |
| 31 | 42 |
| 32 namespace internal { | 43 namespace internal { |
| 33 class WorkspaceController; | 44 class WorkspaceController; |
| 34 } | 45 } |
| 35 | 46 |
| 36 // Shell is a singleton object that presents the Shell API and implements the | 47 // Shell is a singleton object that presents the Shell API and implements the |
| 37 // Desktop's delegate interface. | 48 // Desktop's delegate interface. |
| 38 class AURA_SHELL_EXPORT Shell : public aura::DesktopDelegate { | 49 class AURA_SHELL_EXPORT Shell : public aura::DesktopDelegate, |
| 50 public aura::DragDropController { |
| 39 public: | 51 public: |
| 40 // Upon creation, the Shell sets itself as the Desktop's delegate, which takes | 52 // Upon creation, the Shell sets itself as the Desktop's delegate, which takes |
| 41 // ownership of the Shell. | 53 // ownership of the Shell. |
| 42 Shell(); | 54 Shell(); |
| 43 virtual ~Shell(); | 55 virtual ~Shell(); |
| 44 | 56 |
| 45 static Shell* GetInstance(); | 57 static Shell* GetInstance(); |
| 46 | 58 |
| 47 void Init(); | 59 void Init(); |
| 48 | 60 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 61 private: | 73 private: |
| 62 typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair; | 74 typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair; |
| 63 | 75 |
| 64 // Enables WorkspaceManager. | 76 // Enables WorkspaceManager. |
| 65 void EnableWorkspaceManager(); | 77 void EnableWorkspaceManager(); |
| 66 | 78 |
| 67 // Overridden from aura::DesktopDelegate: | 79 // Overridden from aura::DesktopDelegate: |
| 68 virtual void AddChildToDefaultParent(aura::Window* window) OVERRIDE; | 80 virtual void AddChildToDefaultParent(aura::Window* window) OVERRIDE; |
| 69 virtual aura::Window* GetTopmostWindowToActivate( | 81 virtual aura::Window* GetTopmostWindowToActivate( |
| 70 aura::Window* ignore) const OVERRIDE; | 82 aura::Window* ignore) const OVERRIDE; |
| 83 virtual DragDropController* GetDragDropController() const OVERRIDE; |
| 84 |
| 85 // Overridden from aura::DragDropController: |
| 86 virtual void StartDragAndDrop(const ui::OSExchangeData& data, |
| 87 int operation, |
| 88 const gfx::Point& location) OVERRIDE; |
| 89 virtual void DragUpdate(const aura::MouseEvent& event) OVERRIDE; |
| 90 virtual void Drop(const aura::MouseEvent& event) OVERRIDE; |
| 71 | 91 |
| 72 static Shell* instance_; | 92 static Shell* instance_; |
| 73 | 93 |
| 74 std::vector<WindowAndBoundsPair> to_restore_; | 94 std::vector<WindowAndBoundsPair> to_restore_; |
| 75 | 95 |
| 76 base::WeakPtrFactory<Shell> method_factory_; | 96 base::WeakPtrFactory<Shell> method_factory_; |
| 77 | 97 |
| 78 scoped_ptr<ShellDelegate> delegate_; | 98 scoped_ptr<ShellDelegate> delegate_; |
| 79 | 99 |
| 80 scoped_ptr<Launcher> launcher_; | 100 scoped_ptr<Launcher> launcher_; |
| 81 | 101 |
| 82 scoped_ptr<internal::WorkspaceController> workspace_controller_; | 102 scoped_ptr<internal::WorkspaceController> workspace_controller_; |
| 83 | 103 |
| 104 const ui::OSExchangeData* drag_data_; |
| 105 scoped_ptr<views::Widget> drag_widget_; |
| 106 |
| 84 DISALLOW_COPY_AND_ASSIGN(Shell); | 107 DISALLOW_COPY_AND_ASSIGN(Shell); |
| 85 }; | 108 }; |
| 86 | 109 |
| 87 } // namespace aura_shell | 110 } // namespace aura_shell |
| 88 | 111 |
| 89 #endif // UI_AURA_SHELL_SHELL_H_ | 112 #endif // UI_AURA_SHELL_SHELL_H_ |
| OLD | NEW |