| 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_MULTI_PROFILE_APP_WINDOW_LAUNCHER_CONTROL
LER_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_MULTI_PROFILE_APP_WINDOW_LAUNCHER_CONTROL
LER_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_MULTI_PROFILE_APP_WINDOW_LAUNCHER_CONTROL
LER_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_MULTI_PROFILE_APP_WINDOW_LAUNCHER_CONTROL
LER_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/ui/ash/launcher/app_window_launcher_controller.h" | 8 #include "chrome/browser/ui/ash/launcher/app_window_launcher_controller.h" |
| 9 | 9 |
| 10 namespace user_manager { |
| 11 class UserID; |
| 12 } |
| 13 |
| 10 // Inherits from AppWindowLauncherController and overwrites the AppWindow | 14 // Inherits from AppWindowLauncherController and overwrites the AppWindow |
| 11 // observing functions to switch between users dynamically. | 15 // observing functions to switch between users dynamically. |
| 12 class MultiProfileAppWindowLauncherController | 16 class MultiProfileAppWindowLauncherController |
| 13 : public AppWindowLauncherController { | 17 : public AppWindowLauncherController { |
| 14 public: | 18 public: |
| 15 explicit MultiProfileAppWindowLauncherController( | 19 explicit MultiProfileAppWindowLauncherController( |
| 16 ChromeLauncherController* owner); | 20 ChromeLauncherController* owner); |
| 17 ~MultiProfileAppWindowLauncherController() override; | 21 ~MultiProfileAppWindowLauncherController() override; |
| 18 | 22 |
| 19 // Overridden from AppWindowLauncherController: | 23 // Overridden from AppWindowLauncherController: |
| 20 void ActiveUserChanged(const std::string& user_email) override; | 24 void ActiveUserChanged(const user_manager::UserID& user_id) override; |
| 21 void AdditionalUserAddedToSession(Profile* profile) override; | 25 void AdditionalUserAddedToSession(Profile* profile) override; |
| 22 | 26 |
| 23 // Overridden from AppWindowRegistry::Observer: | 27 // Overridden from AppWindowRegistry::Observer: |
| 24 void OnAppWindowAdded(extensions::AppWindow* app_window) override; | 28 void OnAppWindowAdded(extensions::AppWindow* app_window) override; |
| 25 void OnAppWindowRemoved(extensions::AppWindow* app_window) override; | 29 void OnAppWindowRemoved(extensions::AppWindow* app_window) override; |
| 26 void OnAppWindowShown(extensions::AppWindow* app_window, | 30 void OnAppWindowShown(extensions::AppWindow* app_window, |
| 27 bool was_hidden) override; | 31 bool was_hidden) override; |
| 28 void OnAppWindowHidden(extensions::AppWindow* app_window) override; | 32 void OnAppWindowHidden(extensions::AppWindow* app_window) override; |
| 29 | 33 |
| 30 private: | 34 private: |
| 31 typedef std::vector<extensions::AppWindow*> AppWindowList; | 35 typedef std::vector<extensions::AppWindow*> AppWindowList; |
| 32 typedef std::vector<extensions::AppWindowRegistry*> AppWindowRegistryList; | 36 typedef std::vector<extensions::AppWindowRegistry*> AppWindowRegistryList; |
| 33 | 37 |
| 34 // Returns true if the owner of the given |app_window| has a window teleported | 38 // Returns true if the owner of the given |app_window| has a window teleported |
| 35 // of the |app_window|'s application type to the current desktop. | 39 // of the |app_window|'s application type to the current desktop. |
| 36 bool UserHasAppOnActiveDesktop(extensions::AppWindow* app_window); | 40 bool UserHasAppOnActiveDesktop(extensions::AppWindow* app_window); |
| 37 | 41 |
| 38 // A list of all app windows for all users. | 42 // A list of all app windows for all users. |
| 39 AppWindowList app_window_list_; | 43 AppWindowList app_window_list_; |
| 40 | 44 |
| 41 // A list of the app window registries which we additionally observe. | 45 // A list of the app window registries which we additionally observe. |
| 42 AppWindowRegistryList multi_user_registry_; | 46 AppWindowRegistryList multi_user_registry_; |
| 43 | 47 |
| 44 DISALLOW_COPY_AND_ASSIGN(MultiProfileAppWindowLauncherController); | 48 DISALLOW_COPY_AND_ASSIGN(MultiProfileAppWindowLauncherController); |
| 45 }; | 49 }; |
| 46 | 50 |
| 47 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_MULTI_PROFILE_APP_WINDOW_LAUNCHER_CONT
ROLLER_H_ | 51 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_MULTI_PROFILE_APP_WINDOW_LAUNCHER_CONT
ROLLER_H_ |
| OLD | NEW |