Chromium Code Reviews| 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 <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "ash/session_state_observer.h" | 11 #include "ash/session_state_observer.h" |
| 12 #include "ash/wm/window_state_observer.h" | 12 #include "ash/wm/window_state_observer.h" |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/memory/scoped_ptr.h" | |
| 14 #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" |
| 15 #include "content/public/browser/notification_observer.h" | 16 #include "content/public/browser/notification_observer.h" |
| 16 #include "content/public/browser/notification_registrar.h" | 17 #include "content/public/browser/notification_registrar.h" |
| 17 #include "ui/aura/window_observer.h" | 18 #include "ui/aura/window_observer.h" |
| 18 | 19 |
| 19 class Browser; | 20 class Browser; |
| 21 class MultiUserNotificationBlockerChromeOS; | |
| 22 class MultiUserNotificationBlockerChromeOSTest; | |
| 20 class Profile; | 23 class Profile; |
| 21 | 24 |
| 22 namespace aura { | 25 namespace aura { |
| 23 class Window; | 26 class Window; |
| 24 class WindowObserver; | 27 class WindowObserver; |
| 25 } | 28 } |
| 26 | 29 |
| 27 namespace chrome { | 30 namespace chrome { |
| 28 | 31 |
| 29 class AppObserver; | 32 class AppObserver; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 82 virtual void OnWindowShowTypeChanged( | 85 virtual void OnWindowShowTypeChanged( |
| 83 ash::wm::WindowState* state, | 86 ash::wm::WindowState* state, |
| 84 ash::wm::WindowShowType old_type) OVERRIDE; | 87 ash::wm::WindowShowType old_type) OVERRIDE; |
| 85 | 88 |
| 86 // content::NotificationObserver overrides: | 89 // content::NotificationObserver overrides: |
| 87 virtual void Observe(int type, | 90 virtual void Observe(int type, |
| 88 const content::NotificationSource& source, | 91 const content::NotificationSource& source, |
| 89 const content::NotificationDetails& details) OVERRIDE; | 92 const content::NotificationDetails& details) OVERRIDE; |
| 90 | 93 |
| 91 private: | 94 private: |
| 95 friend class ::MultiUserNotificationBlockerChromeOSTest; | |
| 96 | |
| 92 class WindowEntry { | 97 class WindowEntry { |
| 93 public: | 98 public: |
| 94 explicit WindowEntry(const std::string& user_id) | 99 explicit WindowEntry(const std::string& user_id) |
| 95 : owner_(user_id), | 100 : owner_(user_id), |
| 96 show_for_user_(user_id), | 101 show_for_user_(user_id), |
| 97 show_(true) {} | 102 show_(true) {} |
| 98 virtual ~WindowEntry() {} | 103 virtual ~WindowEntry() {} |
| 99 | 104 |
| 100 // Returns the owner of this window. This cannot be changed. | 105 // Returns the owner of this window. This cannot be changed. |
| 101 const std::string& owner() const { return owner_; } | 106 const std::string& owner() const { return owner_; } |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 168 UserIDToShellWindowObserver user_id_to_app_observer_; | 173 UserIDToShellWindowObserver user_id_to_app_observer_; |
| 169 | 174 |
| 170 // A map which remembers for owned transient windows their own visibility. | 175 // A map which remembers for owned transient windows their own visibility. |
| 171 TransientWindowToVisibility transient_window_to_visibility_; | 176 TransientWindowToVisibility transient_window_to_visibility_; |
| 172 | 177 |
| 173 // The currently selected active user. It is used to find the proper | 178 // The currently selected active user. It is used to find the proper |
| 174 // visibility state in various cases. The state is stored here instead of | 179 // visibility state in various cases. The state is stored here instead of |
| 175 // being read from the user manager to be in sync while a switch occurs. | 180 // being read from the user manager to be in sync while a switch occurs. |
| 176 std::string current_user_id_; | 181 std::string current_user_id_; |
| 177 | 182 |
| 183 // The blocker to controls the desktop notification visibility based on the | |
|
Mr4D (OOO till 08-26)
2014/01/08 17:29:35
Nit: "The blocker which controls .." - or better -
Jun Mukai
2014/01/08 20:41:24
Done.
| |
| 184 // current multi-user status. | |
| 185 scoped_ptr<MultiUserNotificationBlockerChromeOS> notification_blocker_; | |
| 186 | |
| 178 // The notification registrar to track the creation of browser windows. | 187 // The notification registrar to track the creation of browser windows. |
| 179 content::NotificationRegistrar registrar_; | 188 content::NotificationRegistrar registrar_; |
| 180 | 189 |
| 181 // Suppress changes to the visibility flag while we are changing it ourselves. | 190 // Suppress changes to the visibility flag while we are changing it ourselves. |
| 182 bool suppress_visibility_changes_; | 191 bool suppress_visibility_changes_; |
| 183 | 192 |
| 184 // Caching the current multi profile mode since the detection which mode is | 193 // Caching the current multi profile mode since the detection which mode is |
| 185 // used is quite expensive. | 194 // used is quite expensive. |
| 186 static MultiProfileMode multi_user_mode_; | 195 static MultiProfileMode multi_user_mode_; |
| 187 | 196 |
| 188 DISALLOW_COPY_AND_ASSIGN(MultiUserWindowManagerChromeOS); | 197 DISALLOW_COPY_AND_ASSIGN(MultiUserWindowManagerChromeOS); |
| 189 }; | 198 }; |
| 190 | 199 |
| 191 } // namespace chrome | 200 } // namespace chrome |
| 192 | 201 |
| 193 #endif // CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WINDOW_MANAGER_CHROMEOS_H _ | 202 #endif // CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WINDOW_MANAGER_CHROMEOS_H _ |
| OLD | NEW |