Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h

Issue 127423002: Supports window teleports for notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 21 matching lines...) Expand all
51 explicit MultiUserWindowManagerChromeOS(const std::string& active_user_id); 54 explicit MultiUserWindowManagerChromeOS(const std::string& active_user_id);
52 virtual ~MultiUserWindowManagerChromeOS(); 55 virtual ~MultiUserWindowManagerChromeOS();
53 56
54 // MultiUserWindowManager overrides: 57 // MultiUserWindowManager overrides:
55 virtual void SetWindowOwner( 58 virtual void SetWindowOwner(
56 aura::Window* window, const std::string& user_id) OVERRIDE; 59 aura::Window* window, const std::string& user_id) OVERRIDE;
57 virtual const std::string& GetWindowOwner(aura::Window* window) OVERRIDE; 60 virtual const std::string& GetWindowOwner(aura::Window* window) OVERRIDE;
58 virtual void ShowWindowForUser( 61 virtual void ShowWindowForUser(
59 aura::Window* window, const std::string& user_id) OVERRIDE; 62 aura::Window* window, const std::string& user_id) OVERRIDE;
60 virtual bool AreWindowsSharedAmongUsers() OVERRIDE; 63 virtual bool AreWindowsSharedAmongUsers() OVERRIDE;
64 virtual void GetWindowOwners(std::set<std::string>* user_ids) OVERRIDE;
Mr4D (OOO till 08-26) 2014/01/08 20:53:53 This should possibly be GetOwnersOfVisibleWindows.
Jun Mukai 2014/01/08 21:20:17 Done.
61 virtual bool IsWindowOnDesktopOfUser(aura::Window* window, 65 virtual bool IsWindowOnDesktopOfUser(aura::Window* window,
62 const std::string& user_id) OVERRIDE; 66 const std::string& user_id) OVERRIDE;
63 virtual const std::string& GetUserPresentingWindow( 67 virtual const std::string& GetUserPresentingWindow(
64 aura::Window* window) OVERRIDE; 68 aura::Window* window) OVERRIDE;
65 virtual void AddUser(Profile* profile) OVERRIDE; 69 virtual void AddUser(Profile* profile) OVERRIDE;
66 70
67 // SessionStateObserver overrides: 71 // SessionStateObserver overrides:
68 virtual void ActiveUserChanged(const std::string& user_id) OVERRIDE; 72 virtual void ActiveUserChanged(const std::string& user_id) OVERRIDE;
69 73
70 // WindowObserver overrides: 74 // WindowObserver overrides:
(...skipping 11 matching lines...) Expand all
82 virtual void OnWindowShowTypeChanged( 86 virtual void OnWindowShowTypeChanged(
83 ash::wm::WindowState* state, 87 ash::wm::WindowState* state,
84 ash::wm::WindowShowType old_type) OVERRIDE; 88 ash::wm::WindowShowType old_type) OVERRIDE;
85 89
86 // content::NotificationObserver overrides: 90 // content::NotificationObserver overrides:
87 virtual void Observe(int type, 91 virtual void Observe(int type,
88 const content::NotificationSource& source, 92 const content::NotificationSource& source,
89 const content::NotificationDetails& details) OVERRIDE; 93 const content::NotificationDetails& details) OVERRIDE;
90 94
91 private: 95 private:
96 friend class ::MultiUserNotificationBlockerChromeOSTest;
97
92 class WindowEntry { 98 class WindowEntry {
93 public: 99 public:
94 explicit WindowEntry(const std::string& user_id) 100 explicit WindowEntry(const std::string& user_id)
95 : owner_(user_id), 101 : owner_(user_id),
96 show_for_user_(user_id), 102 show_for_user_(user_id),
97 show_(true) {} 103 show_(true) {}
98 virtual ~WindowEntry() {} 104 virtual ~WindowEntry() {}
99 105
100 // Returns the owner of this window. This cannot be changed. 106 // Returns the owner of this window. This cannot be changed.
101 const std::string& owner() const { return owner_; } 107 const std::string& owner() const { return owner_; }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 UserIDToShellWindowObserver user_id_to_app_observer_; 174 UserIDToShellWindowObserver user_id_to_app_observer_;
169 175
170 // A map which remembers for owned transient windows their own visibility. 176 // A map which remembers for owned transient windows their own visibility.
171 TransientWindowToVisibility transient_window_to_visibility_; 177 TransientWindowToVisibility transient_window_to_visibility_;
172 178
173 // The currently selected active user. It is used to find the proper 179 // 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 180 // 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. 181 // being read from the user manager to be in sync while a switch occurs.
176 std::string current_user_id_; 182 std::string current_user_id_;
177 183
184 // The blocker which controls the desktop notification visibility based on the
185 // current multi-user status.
186 scoped_ptr<MultiUserNotificationBlockerChromeOS> notification_blocker_;
187
178 // The notification registrar to track the creation of browser windows. 188 // The notification registrar to track the creation of browser windows.
179 content::NotificationRegistrar registrar_; 189 content::NotificationRegistrar registrar_;
180 190
181 // Suppress changes to the visibility flag while we are changing it ourselves. 191 // Suppress changes to the visibility flag while we are changing it ourselves.
182 bool suppress_visibility_changes_; 192 bool suppress_visibility_changes_;
183 193
184 // Caching the current multi profile mode since the detection which mode is 194 // Caching the current multi profile mode since the detection which mode is
185 // used is quite expensive. 195 // used is quite expensive.
186 static MultiProfileMode multi_user_mode_; 196 static MultiProfileMode multi_user_mode_;
187 197
188 DISALLOW_COPY_AND_ASSIGN(MultiUserWindowManagerChromeOS); 198 DISALLOW_COPY_AND_ASSIGN(MultiUserWindowManagerChromeOS);
189 }; 199 };
190 200
191 } // namespace chrome 201 } // namespace chrome
192 202
193 #endif // CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WINDOW_MANAGER_CHROMEOS_H _ 203 #endif // CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WINDOW_MANAGER_CHROMEOS_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698