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> |
(...skipping 30 matching lines...) Expand all Loading... |
41 public: | 41 public: |
42 explicit ShellWindowLauncherController(ChromeLauncherController* owner); | 42 explicit ShellWindowLauncherController(ChromeLauncherController* owner); |
43 virtual ~ShellWindowLauncherController(); | 43 virtual ~ShellWindowLauncherController(); |
44 | 44 |
45 // Called by ChromeLauncherController when the active user changed and the | 45 // Called by ChromeLauncherController when the active user changed and the |
46 // items need to be updated. | 46 // items need to be updated. |
47 virtual void ActiveUserChanged(const std::string& user_email) {} | 47 virtual void ActiveUserChanged(const std::string& user_email) {} |
48 | 48 |
49 // An additional user identified by |Profile|, got added to the existing | 49 // An additional user identified by |Profile|, got added to the existing |
50 // session. | 50 // session. |
51 virtual void AdditionalUserAddedToSession(Profile* profile) {} | 51 virtual void AdditionalUserAddedToSession(Profile* profile); |
52 | 52 |
53 // Overridden from ShellWindowRegistry::Observer: | 53 // Overridden from ShellWindowRegistry::Observer: |
54 virtual void OnShellWindowAdded(apps::ShellWindow* shell_window) OVERRIDE; | 54 virtual void OnShellWindowAdded(apps::ShellWindow* shell_window) OVERRIDE; |
55 virtual void OnShellWindowIconChanged( | 55 virtual void OnShellWindowIconChanged( |
56 apps::ShellWindow* shell_window) OVERRIDE; | 56 apps::ShellWindow* shell_window) OVERRIDE; |
57 virtual void OnShellWindowRemoved(apps::ShellWindow* shell_window) OVERRIDE; | 57 virtual void OnShellWindowRemoved(apps::ShellWindow* shell_window) OVERRIDE; |
58 | 58 |
59 // Overriden from aura::WindowObserver: | 59 // Overriden from aura::WindowObserver: |
60 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; | 60 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; |
61 | 61 |
(...skipping 12 matching lines...) Expand all Loading... |
74 bool IsRegisteredApp(aura::Window* window); | 74 bool IsRegisteredApp(aura::Window* window); |
75 | 75 |
76 private: | 76 private: |
77 typedef std::map<std::string, ShellWindowLauncherItemController*> | 77 typedef std::map<std::string, ShellWindowLauncherItemController*> |
78 AppControllerMap; | 78 AppControllerMap; |
79 typedef std::map<aura::Window*, std::string> WindowToAppLauncherIdMap; | 79 typedef std::map<aura::Window*, std::string> WindowToAppLauncherIdMap; |
80 | 80 |
81 ShellWindowLauncherItemController* ControllerForWindow(aura::Window* window); | 81 ShellWindowLauncherItemController* ControllerForWindow(aura::Window* window); |
82 | 82 |
83 ChromeLauncherController* owner_; | 83 ChromeLauncherController* owner_; |
84 apps::ShellWindowRegistry* registry_; // Unowned convenience pointer | 84 // A set of unowned ShellWindowRegistry pointers for loaded users. |
| 85 // Note that this will only be used with multiple users in the side by side |
| 86 // mode. |
| 87 std::set<apps::ShellWindowRegistry*> registry_; |
85 aura::client::ActivationClient* activation_client_; | 88 aura::client::ActivationClient* activation_client_; |
86 | 89 |
87 // Map of app launcher id to controller. | 90 // Map of app launcher id to controller. |
88 AppControllerMap app_controller_map_; | 91 AppControllerMap app_controller_map_; |
89 | 92 |
90 // Allows us to get from an aura::Window to the app launcher id. | 93 // Allows us to get from an aura::Window to the app launcher id. |
91 WindowToAppLauncherIdMap window_to_app_launcher_id_map_; | 94 WindowToAppLauncherIdMap window_to_app_launcher_id_map_; |
92 | 95 |
93 DISALLOW_COPY_AND_ASSIGN(ShellWindowLauncherController); | 96 DISALLOW_COPY_AND_ASSIGN(ShellWindowLauncherController); |
94 }; | 97 }; |
95 | 98 |
96 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_SHELL_WINDOW_LAUNCHER_CONTROLLER_H_ | 99 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_SHELL_WINDOW_LAUNCHER_CONTROLLER_H_ |
OLD | NEW |