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_WORKSPACE_CONTROLLER_H_ | 5 #ifndef UI_AURA_SHELL_WORKSPACE_CONTROLLER_H_ |
6 #define UI_AURA_SHELL_WORKSPACE_CONTROLLER_H_ | 6 #define UI_AURA_SHELL_WORKSPACE_CONTROLLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "ui/aura/root_window_observer.h" | 11 #include "ui/aura/root_window_observer.h" |
| 12 #include "ui/aura/window_observer.h" |
12 #include "ui/aura_shell/aura_shell_export.h" | 13 #include "ui/aura_shell/aura_shell_export.h" |
13 #include "ui/aura_shell/launcher/launcher_model_observer.h" | 14 #include "ui/aura_shell/launcher/launcher_model_observer.h" |
14 #include "ui/aura_shell/workspace/workspace_observer.h" | 15 #include "ui/aura_shell/workspace/workspace_observer.h" |
15 | 16 |
16 namespace aura { | 17 namespace aura { |
17 class Window; | 18 class Window; |
18 } | 19 } |
19 | 20 |
20 namespace gfx { | 21 namespace gfx { |
21 class Size; | 22 class Size; |
22 } | 23 } |
23 | 24 |
24 namespace aura_shell { | 25 namespace aura_shell { |
25 class LauncherModel; | 26 class LauncherModel; |
26 | 27 |
27 namespace internal { | 28 namespace internal { |
28 | 29 |
29 class WorkspaceManager; | 30 class WorkspaceManager; |
30 | 31 |
31 // WorkspaceControlls owns a WorkspaceManager. WorkspaceControlls bridges | 32 // WorkspaceControlls owns a WorkspaceManager. WorkspaceControlls bridges |
32 // events From RootWindowObserver translating them to WorkspaceManager, and | 33 // events From RootWindowObserver translating them to WorkspaceManager, and |
33 // a move event between Laucher and Workspace. | 34 // a move event between Laucher and Workspace. |
34 class AURA_SHELL_EXPORT WorkspaceController : | 35 class AURA_SHELL_EXPORT WorkspaceController : |
35 public aura::RootWindowObserver, | 36 public aura::RootWindowObserver, |
| 37 public aura::WindowObserver, |
36 public aura_shell::internal::WorkspaceObserver, | 38 public aura_shell::internal::WorkspaceObserver, |
37 public aura_shell::LauncherModelObserver { | 39 public aura_shell::LauncherModelObserver { |
38 public: | 40 public: |
39 explicit WorkspaceController(aura::Window* workspace_viewport); | 41 explicit WorkspaceController(aura::Window* workspace_viewport); |
40 virtual ~WorkspaceController(); | 42 virtual ~WorkspaceController(); |
41 | 43 |
42 void ToggleOverview(); | 44 void ToggleOverview(); |
43 | 45 |
44 void SetLauncherModel(LauncherModel* launcher_model); | 46 void SetLauncherModel(LauncherModel* launcher_model); |
45 | 47 |
46 // Returns the workspace manager that this controler owns. | 48 // Returns the workspace manager that this controler owns. |
47 WorkspaceManager* workspace_manager() { | 49 WorkspaceManager* workspace_manager() { |
48 return workspace_manager_.get(); | 50 return workspace_manager_.get(); |
49 } | 51 } |
50 | 52 |
51 // RootWindowObserver overrides: | 53 // aura::RootWindowObserver overrides: |
52 virtual void OnRootWindowResized(const gfx::Size& new_size) OVERRIDE; | 54 virtual void OnRootWindowResized(const gfx::Size& new_size) OVERRIDE; |
53 virtual void OnActiveWindowChanged(aura::Window* active) OVERRIDE; | 55 |
| 56 // aura::WindowObserver overrides: |
| 57 virtual void OnWindowPropertyChanged(aura::Window* window, |
| 58 const char* key, |
| 59 void* old) OVERRIDE; |
54 | 60 |
55 // WorkspaceObserver overrides: | 61 // WorkspaceObserver overrides: |
56 virtual void WindowMoved(WorkspaceManager* manager, | 62 virtual void WindowMoved(WorkspaceManager* manager, |
57 aura::Window* source, | 63 aura::Window* source, |
58 aura::Window* target) OVERRIDE; | 64 aura::Window* target) OVERRIDE; |
59 virtual void ActiveWorkspaceChanged(WorkspaceManager* manager, | 65 virtual void ActiveWorkspaceChanged(WorkspaceManager* manager, |
60 Workspace* old) OVERRIDE; | 66 Workspace* old) OVERRIDE; |
61 | 67 |
62 // Invoked after an item has been added to the model. | 68 // Invoked after an item has been added to the model. |
63 virtual void LauncherItemAdded(int index) OVERRIDE; | 69 virtual void LauncherItemAdded(int index) OVERRIDE; |
(...skipping 11 matching lines...) Expand all Loading... |
75 // Used to prevent infinite recursive call between the workspace and launcher. | 81 // Used to prevent infinite recursive call between the workspace and launcher. |
76 bool ignore_move_event_; | 82 bool ignore_move_event_; |
77 | 83 |
78 DISALLOW_COPY_AND_ASSIGN(WorkspaceController); | 84 DISALLOW_COPY_AND_ASSIGN(WorkspaceController); |
79 }; | 85 }; |
80 | 86 |
81 } // namespace internal | 87 } // namespace internal |
82 } // namespace aura_shell | 88 } // namespace aura_shell |
83 | 89 |
84 #endif // UI_AURA_SHELL_WORKSPACE_CONTROLLER_H_ | 90 #endif // UI_AURA_SHELL_WORKSPACE_CONTROLLER_H_ |
OLD | NEW |