| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_MULTI_USER_MULTI_USER_WINDOW_MANAGER_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WINDOW_MANAGER_CHROMEOS_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WINDOW_MANAGER_CHROMEOS_H_ | 6 #define CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WINDOW_MANAGER_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "ash/common/session/session_state_observer.h" | |
| 13 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 14 #include "base/macros.h" | 13 #include "base/macros.h" |
| 15 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
| 16 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" | 15 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" |
| 17 #include "components/signin/core/account_id/account_id.h" | 16 #include "components/signin/core/account_id/account_id.h" |
| 17 #include "components/user_manager/user_manager.h" |
| 18 #include "content/public/browser/notification_observer.h" | 18 #include "content/public/browser/notification_observer.h" |
| 19 #include "content/public/browser/notification_registrar.h" | 19 #include "content/public/browser/notification_registrar.h" |
| 20 #include "ui/aura/window_observer.h" | 20 #include "ui/aura/window_observer.h" |
| 21 #include "ui/wm/core/transient_window_observer.h" | 21 #include "ui/wm/core/transient_window_observer.h" |
| 22 | 22 |
| 23 class Browser; | 23 class Browser; |
| 24 class MultiUserNotificationBlockerChromeOS; | 24 class MultiUserNotificationBlockerChromeOS; |
| 25 class MultiUserNotificationBlockerChromeOSTest; | 25 class MultiUserNotificationBlockerChromeOSTest; |
| 26 | 26 |
| 27 namespace content { | 27 namespace content { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 51 // Note: | 51 // Note: |
| 52 // - aura::Window::Hide() is currently hiding the window and all owned transient | 52 // - aura::Window::Hide() is currently hiding the window and all owned transient |
| 53 // children. However aura::Window::Show() is only showing the window itself. | 53 // children. However aura::Window::Show() is only showing the window itself. |
| 54 // To address that, all transient children (and their children) are remembered | 54 // To address that, all transient children (and their children) are remembered |
| 55 // in |transient_window_to_visibility_| and monitored to keep track of the | 55 // in |transient_window_to_visibility_| and monitored to keep track of the |
| 56 // visibility changes from the owning user. This way the visibility can be | 56 // visibility changes from the owning user. This way the visibility can be |
| 57 // changed back to its requested state upon showing by us - or when the window | 57 // changed back to its requested state upon showing by us - or when the window |
| 58 // gets detached from its current owning parent. | 58 // gets detached from its current owning parent. |
| 59 class MultiUserWindowManagerChromeOS | 59 class MultiUserWindowManagerChromeOS |
| 60 : public MultiUserWindowManager, | 60 : public MultiUserWindowManager, |
| 61 public ash::SessionStateObserver, | 61 public user_manager::UserManager::UserSessionStateObserver, |
| 62 public aura::WindowObserver, | 62 public aura::WindowObserver, |
| 63 public content::NotificationObserver, | 63 public content::NotificationObserver, |
| 64 public wm::TransientWindowObserver { | 64 public wm::TransientWindowObserver { |
| 65 public: | 65 public: |
| 66 // The speed which should be used to perform animations. | 66 // The speed which should be used to perform animations. |
| 67 enum AnimationSpeed { | 67 enum AnimationSpeed { |
| 68 ANIMATION_SPEED_NORMAL, // The normal animation speed. | 68 ANIMATION_SPEED_NORMAL, // The normal animation speed. |
| 69 ANIMATION_SPEED_FAST, // Unit test speed which test animations. | 69 ANIMATION_SPEED_FAST, // Unit test speed which test animations. |
| 70 ANIMATION_SPEED_DISABLED // Unit tests which do not require animations. | 70 ANIMATION_SPEED_DISABLED // Unit tests which do not require animations. |
| 71 }; | 71 }; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 86 bool AreWindowsSharedAmongUsers() const override; | 86 bool AreWindowsSharedAmongUsers() const override; |
| 87 void GetOwnersOfVisibleWindows( | 87 void GetOwnersOfVisibleWindows( |
| 88 std::set<AccountId>* account_ids) const override; | 88 std::set<AccountId>* account_ids) const override; |
| 89 bool IsWindowOnDesktopOfUser(aura::Window* window, | 89 bool IsWindowOnDesktopOfUser(aura::Window* window, |
| 90 const AccountId& account_id) const override; | 90 const AccountId& account_id) const override; |
| 91 const AccountId& GetUserPresentingWindow(aura::Window* window) const override; | 91 const AccountId& GetUserPresentingWindow(aura::Window* window) const override; |
| 92 void AddUser(content::BrowserContext* context) override; | 92 void AddUser(content::BrowserContext* context) override; |
| 93 void AddObserver(Observer* observer) override; | 93 void AddObserver(Observer* observer) override; |
| 94 void RemoveObserver(Observer* observer) override; | 94 void RemoveObserver(Observer* observer) override; |
| 95 | 95 |
| 96 // SessionStateObserver overrides: | 96 // user_manager::UserManager::UserSessionStateObserver overrides: |
| 97 void ActiveUserChanged(const AccountId& account_id) override; | 97 void ActiveUserChanged(const user_manager::User* active_user) override; |
| 98 | 98 |
| 99 // WindowObserver overrides: | 99 // WindowObserver overrides: |
| 100 void OnWindowDestroyed(aura::Window* window) override; | 100 void OnWindowDestroyed(aura::Window* window) override; |
| 101 void OnWindowVisibilityChanging(aura::Window* window, bool visible) override; | 101 void OnWindowVisibilityChanging(aura::Window* window, bool visible) override; |
| 102 void OnWindowVisibilityChanged(aura::Window* window, bool visible) override; | 102 void OnWindowVisibilityChanged(aura::Window* window, bool visible) override; |
| 103 | 103 |
| 104 // TransientWindowObserver overrides: | 104 // TransientWindowObserver overrides: |
| 105 void OnTransientChildAdded(aura::Window* window, | 105 void OnTransientChildAdded(aura::Window* window, |
| 106 aura::Window* transient) override; | 106 aura::Window* transient) override; |
| 107 void OnTransientChildRemoved(aura::Window* window, | 107 void OnTransientChildRemoved(aura::Window* window, |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 | 259 |
| 260 // The animation between users. | 260 // The animation between users. |
| 261 std::unique_ptr<UserSwitchAnimatorChromeOS> animation_; | 261 std::unique_ptr<UserSwitchAnimatorChromeOS> animation_; |
| 262 | 262 |
| 263 DISALLOW_COPY_AND_ASSIGN(MultiUserWindowManagerChromeOS); | 263 DISALLOW_COPY_AND_ASSIGN(MultiUserWindowManagerChromeOS); |
| 264 }; | 264 }; |
| 265 | 265 |
| 266 } // namespace chrome | 266 } // namespace chrome |
| 267 | 267 |
| 268 #endif // CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WINDOW_MANAGER_CHROMEOS_H
_ | 268 #endif // CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WINDOW_MANAGER_CHROMEOS_H
_ |
| OLD | NEW |