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 CHROME_BROWSER_UI_ASH_LAUNCHER_SHELL_WINDOW_LAUNCHER_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_SHELL_WINDOW_LAUNCHER_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_SHELL_WINDOW_LAUNCHER_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_SHELL_WINDOW_LAUNCHER_CONTROLLER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "chrome/browser/extensions/shell_window_registry.h" | 12 #include "chrome/browser/extensions/shell_window_registry.h" |
13 #include "ui/aura/client/activation_change_observer.h" | 13 #include "ui/aura/client/activation_change_observer.h" |
14 #include "ui/aura/window_observer.h" | 14 #include "ui/aura/window_observer.h" |
15 | 15 |
| 16 namespace apps { |
| 17 class ShellWindow; |
| 18 } |
| 19 |
16 namespace aura { | 20 namespace aura { |
17 | 21 |
18 class Window; | 22 class Window; |
19 | 23 |
20 namespace client { | 24 namespace client { |
21 class ActivationClient; | 25 class ActivationClient; |
22 } | 26 } |
23 | 27 |
24 } | 28 } |
25 | 29 |
26 class ChromeLauncherController; | 30 class ChromeLauncherController; |
27 class ShellWindow; | |
28 class ShellWindowLauncherItemController; | 31 class ShellWindowLauncherItemController; |
29 | 32 |
30 // ShellWindowLauncherController observes the Shell Window registry and the | 33 // ShellWindowLauncherController observes the Shell Window registry and the |
31 // aura window manager. It handles adding and removing launcher items from | 34 // aura window manager. It handles adding and removing launcher items from |
32 // ChromeLauncherController. | 35 // ChromeLauncherController. |
33 class ShellWindowLauncherController | 36 class ShellWindowLauncherController |
34 : public extensions::ShellWindowRegistry::Observer, | 37 : public extensions::ShellWindowRegistry::Observer, |
35 public aura::WindowObserver, | 38 public aura::WindowObserver, |
36 public aura::client::ActivationChangeObserver { | 39 public aura::client::ActivationChangeObserver { |
37 public: | 40 public: |
38 explicit ShellWindowLauncherController(ChromeLauncherController* owner); | 41 explicit ShellWindowLauncherController(ChromeLauncherController* owner); |
39 virtual ~ShellWindowLauncherController(); | 42 virtual ~ShellWindowLauncherController(); |
40 | 43 |
41 // Overridden from ShellWindowRegistry::Observer: | 44 // Overridden from ShellWindowRegistry::Observer: |
42 virtual void OnShellWindowAdded(ShellWindow* shell_window) OVERRIDE; | 45 virtual void OnShellWindowAdded(apps::ShellWindow* shell_window) OVERRIDE; |
43 virtual void OnShellWindowIconChanged(ShellWindow* shell_window) OVERRIDE; | 46 virtual void OnShellWindowIconChanged( |
44 virtual void OnShellWindowRemoved(ShellWindow* shell_window) OVERRIDE; | 47 apps::ShellWindow* shell_window) OVERRIDE; |
| 48 virtual void OnShellWindowRemoved(apps::ShellWindow* shell_window) OVERRIDE; |
45 | 49 |
46 // Overriden from aura::WindowObserver: | 50 // Overriden from aura::WindowObserver: |
47 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; | 51 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; |
48 | 52 |
49 // Overriden from client::ActivationChangeObserver: | 53 // Overriden from client::ActivationChangeObserver: |
50 virtual void OnWindowActivated(aura::Window* gained_active, | 54 virtual void OnWindowActivated(aura::Window* gained_active, |
51 aura::Window* lost_active) OVERRIDE; | 55 aura::Window* lost_active) OVERRIDE; |
52 | 56 |
53 // Returns the number of running applications. | 57 // Returns the number of running applications. |
54 int NumberOfAppsRunning(); | 58 int NumberOfAppsRunning(); |
(...skipping 15 matching lines...) Expand all Loading... |
70 // Map of app launcher id to controller. | 74 // Map of app launcher id to controller. |
71 AppControllerMap app_controller_map_; | 75 AppControllerMap app_controller_map_; |
72 | 76 |
73 // Allows us to get from an aura::Window to the app launcher id. | 77 // Allows us to get from an aura::Window to the app launcher id. |
74 WindowToAppLauncherIdMap window_to_app_launcher_id_map_; | 78 WindowToAppLauncherIdMap window_to_app_launcher_id_map_; |
75 | 79 |
76 DISALLOW_COPY_AND_ASSIGN(ShellWindowLauncherController); | 80 DISALLOW_COPY_AND_ASSIGN(ShellWindowLauncherController); |
77 }; | 81 }; |
78 | 82 |
79 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_SHELL_WINDOW_LAUNCHER_CONTROLLER_H_ | 83 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_SHELL_WINDOW_LAUNCHER_CONTROLLER_H_ |
OLD | NEW |