OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_APP_WINDOW_LAUNCHER_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_APP_WINDOW_LAUNCHER_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_APP_WINDOW_LAUNCHER_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_APP_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 "extensions/browser/app_window/app_window_registry.h" | 12 #include "extensions/browser/app_window/app_window_registry.h" |
13 #include "ui/aura/window_observer.h" | 13 #include "ui/aura/window_observer.h" |
14 #include "ui/wm/public/activation_change_observer.h" | 14 #include "ui/wm/public/activation_change_observer.h" |
15 | 15 |
16 namespace aura { | 16 namespace aura { |
17 | 17 |
18 class Window; | 18 class Window; |
19 | 19 |
20 namespace client { | 20 namespace client { |
21 class ActivationClient; | 21 class ActivationClient; |
22 } | 22 } |
23 } | 23 } |
24 | 24 |
25 namespace extensions { | 25 namespace extensions { |
26 class AppWindow; | 26 class AppWindow; |
27 } | 27 } |
28 | 28 |
| 29 namespace user_manager { |
| 30 class UserID; |
| 31 } |
| 32 |
29 class ChromeLauncherController; | 33 class ChromeLauncherController; |
30 class Profile; | 34 class Profile; |
31 class AppWindowLauncherItemController; | 35 class AppWindowLauncherItemController; |
32 | 36 |
33 // AppWindowLauncherController observes the app window registry and the | 37 // AppWindowLauncherController observes the app window registry and the |
34 // aura window manager. It handles adding and removing launcher items from | 38 // aura window manager. It handles adding and removing launcher items from |
35 // ChromeLauncherController. | 39 // ChromeLauncherController. |
36 class AppWindowLauncherController | 40 class AppWindowLauncherController |
37 : public extensions::AppWindowRegistry::Observer, | 41 : public extensions::AppWindowRegistry::Observer, |
38 public aura::WindowObserver, | 42 public aura::WindowObserver, |
39 public aura::client::ActivationChangeObserver { | 43 public aura::client::ActivationChangeObserver { |
40 public: | 44 public: |
41 explicit AppWindowLauncherController(ChromeLauncherController* owner); | 45 explicit AppWindowLauncherController(ChromeLauncherController* owner); |
42 ~AppWindowLauncherController() override; | 46 ~AppWindowLauncherController() override; |
43 | 47 |
44 // Called by ChromeLauncherController when the active user changed and the | 48 // Called by ChromeLauncherController when the active user changed and the |
45 // items need to be updated. | 49 // items need to be updated. |
46 virtual void ActiveUserChanged(const std::string& user_email) {} | 50 virtual void ActiveUserChanged(const user_manager::UserID& user_email) {} |
47 | 51 |
48 // An additional user identified by |Profile|, got added to the existing | 52 // An additional user identified by |Profile|, got added to the existing |
49 // session. | 53 // session. |
50 virtual void AdditionalUserAddedToSession(Profile* profile); | 54 virtual void AdditionalUserAddedToSession(Profile* profile); |
51 | 55 |
52 // Overridden from AppWindowRegistry::Observer: | 56 // Overridden from AppWindowRegistry::Observer: |
53 void OnAppWindowIconChanged(extensions::AppWindow* app_window) override; | 57 void OnAppWindowIconChanged(extensions::AppWindow* app_window) override; |
54 void OnAppWindowShown(extensions::AppWindow* app_window, | 58 void OnAppWindowShown(extensions::AppWindow* app_window, |
55 bool was_hidden) override; | 59 bool was_hidden) override; |
56 void OnAppWindowHidden(extensions::AppWindow* app_window) override; | 60 void OnAppWindowHidden(extensions::AppWindow* app_window) override; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 // Map of app launcher id to controller. | 93 // Map of app launcher id to controller. |
90 AppControllerMap app_controller_map_; | 94 AppControllerMap app_controller_map_; |
91 | 95 |
92 // Allows us to get from an aura::Window to the app shelf id. | 96 // Allows us to get from an aura::Window to the app shelf id. |
93 WindowToAppShelfIdMap window_to_app_shelf_id_map_; | 97 WindowToAppShelfIdMap window_to_app_shelf_id_map_; |
94 | 98 |
95 DISALLOW_COPY_AND_ASSIGN(AppWindowLauncherController); | 99 DISALLOW_COPY_AND_ASSIGN(AppWindowLauncherController); |
96 }; | 100 }; |
97 | 101 |
98 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_APP_WINDOW_LAUNCHER_CONTROLLER_H_ | 102 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_APP_WINDOW_LAUNCHER_CONTROLLER_H_ |
OLD | NEW |