OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/ui/browser_navigator_browsertest.h" | 5 #include "chrome/browser/ui/browser_navigator_browsertest.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "chrome/browser/chromeos/login/chrome_restart_request.h" | 10 #include "chrome/browser/chromeos/login/chrome_restart_request.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 aura::Window* created_window() { return created_window_; } | 37 aura::Window* created_window() { return created_window_; } |
38 | 38 |
39 // MultiUserWindowManager overrides: | 39 // MultiUserWindowManager overrides: |
40 virtual void SetWindowOwner( | 40 virtual void SetWindowOwner( |
41 aura::Window* window, const std::string& user_id) OVERRIDE; | 41 aura::Window* window, const std::string& user_id) OVERRIDE; |
42 virtual const std::string& GetWindowOwner(aura::Window* window) OVERRIDE; | 42 virtual const std::string& GetWindowOwner(aura::Window* window) OVERRIDE; |
43 virtual void ShowWindowForUser( | 43 virtual void ShowWindowForUser( |
44 aura::Window* window, const std::string& user_id) OVERRIDE; | 44 aura::Window* window, const std::string& user_id) OVERRIDE; |
45 virtual bool AreWindowsSharedAmongUsers() OVERRIDE; | 45 virtual bool AreWindowsSharedAmongUsers() OVERRIDE; |
| 46 virtual void GetOwnersOfVisibleWindows( |
| 47 std::set<std::string>* user_ids) OVERRIDE; |
46 virtual bool IsWindowOnDesktopOfUser(aura::Window* window, | 48 virtual bool IsWindowOnDesktopOfUser(aura::Window* window, |
47 const std::string& user_id) OVERRIDE; | 49 const std::string& user_id) OVERRIDE; |
48 virtual const std::string& GetUserPresentingWindow( | 50 virtual const std::string& GetUserPresentingWindow( |
49 aura::Window* window) OVERRIDE; | 51 aura::Window* window) OVERRIDE; |
50 virtual void AddUser(Profile* profile) OVERRIDE; | 52 virtual void AddUser(Profile* profile) OVERRIDE; |
51 | 53 |
52 private: | 54 private: |
53 // The window of the visiting browser. | 55 // The window of the visiting browser. |
54 aura::Window* browser_window_; | 56 aura::Window* browser_window_; |
55 // The owner of the visiting browser. | 57 // The owner of the visiting browser. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 // If no association has yet been requested remember it now. | 107 // If no association has yet been requested remember it now. |
106 DCHECK(!created_window_); | 108 DCHECK(!created_window_); |
107 created_window_ = window; | 109 created_window_ = window; |
108 created_window_shown_for_ = user_id; | 110 created_window_shown_for_ = user_id; |
109 } | 111 } |
110 | 112 |
111 bool TestMultiUserWindowManager::AreWindowsSharedAmongUsers() { | 113 bool TestMultiUserWindowManager::AreWindowsSharedAmongUsers() { |
112 return browser_owner_ != desktop_owner_; | 114 return browser_owner_ != desktop_owner_; |
113 } | 115 } |
114 | 116 |
| 117 void TestMultiUserWindowManager::GetOwnersOfVisibleWindows( |
| 118 std::set<std::string>* user_ids) { |
| 119 } |
| 120 |
115 bool TestMultiUserWindowManager::IsWindowOnDesktopOfUser( | 121 bool TestMultiUserWindowManager::IsWindowOnDesktopOfUser( |
116 aura::Window* window, | 122 aura::Window* window, |
117 const std::string& user_id) { | 123 const std::string& user_id) { |
118 return GetUserPresentingWindow(window) == user_id; | 124 return GetUserPresentingWindow(window) == user_id; |
119 } | 125 } |
120 | 126 |
121 const std::string& TestMultiUserWindowManager::GetUserPresentingWindow( | 127 const std::string& TestMultiUserWindowManager::GetUserPresentingWindow( |
122 aura::Window* window) { | 128 aura::Window* window) { |
123 if (window == browser_window_) | 129 if (window == browser_window_) |
124 return desktop_owner_; | 130 return desktop_owner_; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 229 |
224 EXPECT_EQ(3u, chrome::GetTotalBrowserCount()); | 230 EXPECT_EQ(3u, chrome::GetTotalBrowserCount()); |
225 | 231 |
226 // The ShowWindowForUser should not have been called since the window is | 232 // The ShowWindowForUser should not have been called since the window is |
227 // already on the correct desktop. | 233 // already on the correct desktop. |
228 ASSERT_FALSE(manager->created_window()); | 234 ASSERT_FALSE(manager->created_window()); |
229 } | 235 } |
230 } | 236 } |
231 | 237 |
232 } // namespace | 238 } // namespace |
OLD | NEW |