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 29 matching lines...) Expand all Loading... |
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( | 46 virtual void GetOwnersOfVisibleWindows( |
47 std::set<std::string>* user_ids) OVERRIDE; | 47 std::set<std::string>* user_ids) OVERRIDE; |
48 virtual bool IsWindowOnDesktopOfUser(aura::Window* window, | 48 virtual bool IsWindowOnDesktopOfUser(aura::Window* window, |
49 const std::string& user_id) OVERRIDE; | 49 const std::string& user_id) OVERRIDE; |
| 50 virtual bool ShouldShowAvatar(aura::Window* window) OVERRIDE; |
50 virtual const std::string& GetUserPresentingWindow( | 51 virtual const std::string& GetUserPresentingWindow( |
51 aura::Window* window) OVERRIDE; | 52 aura::Window* window) OVERRIDE; |
52 virtual void AddUser(Profile* profile) OVERRIDE; | 53 virtual void AddUser(content::BrowserContext* profile) OVERRIDE; |
53 virtual void AddObserver(Observer* observer) OVERRIDE; | 54 virtual void AddObserver(Observer* observer) OVERRIDE; |
54 virtual void RemoveObserver(Observer* observer) OVERRIDE; | 55 virtual void RemoveObserver(Observer* observer) OVERRIDE; |
55 | 56 |
56 private: | 57 private: |
57 // The window of the visiting browser. | 58 // The window of the visiting browser. |
58 aura::Window* browser_window_; | 59 aura::Window* browser_window_; |
59 // The owner of the visiting browser. | 60 // The owner of the visiting browser. |
60 std::string browser_owner_; | 61 std::string browser_owner_; |
61 // The owner of the currently shown desktop. | 62 // The owner of the currently shown desktop. |
62 std::string desktop_owner_; | 63 std::string desktop_owner_; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 void TestMultiUserWindowManager::GetOwnersOfVisibleWindows( | 120 void TestMultiUserWindowManager::GetOwnersOfVisibleWindows( |
120 std::set<std::string>* user_ids) { | 121 std::set<std::string>* user_ids) { |
121 } | 122 } |
122 | 123 |
123 bool TestMultiUserWindowManager::IsWindowOnDesktopOfUser( | 124 bool TestMultiUserWindowManager::IsWindowOnDesktopOfUser( |
124 aura::Window* window, | 125 aura::Window* window, |
125 const std::string& user_id) { | 126 const std::string& user_id) { |
126 return GetUserPresentingWindow(window) == user_id; | 127 return GetUserPresentingWindow(window) == user_id; |
127 } | 128 } |
128 | 129 |
| 130 bool TestMultiUserWindowManager::ShouldShowAvatar(aura::Window* window) { |
| 131 return false; |
| 132 } |
| 133 |
129 const std::string& TestMultiUserWindowManager::GetUserPresentingWindow( | 134 const std::string& TestMultiUserWindowManager::GetUserPresentingWindow( |
130 aura::Window* window) { | 135 aura::Window* window) { |
131 if (window == browser_window_) | 136 if (window == browser_window_) |
132 return desktop_owner_; | 137 return desktop_owner_; |
133 if (created_window_ && window == created_window_) | 138 if (created_window_ && window == created_window_) |
134 return created_window_shown_for_; | 139 return created_window_shown_for_; |
135 // We can come here before the window gets registered. | 140 // We can come here before the window gets registered. |
136 return browser_owner_; | 141 return browser_owner_; |
137 } | 142 } |
138 | 143 |
139 void TestMultiUserWindowManager::AddUser(Profile* profile) { | 144 void TestMultiUserWindowManager::AddUser(content::BrowserContext* profile) { |
140 } | 145 } |
141 | 146 |
142 void TestMultiUserWindowManager::AddObserver(Observer* observer) { | 147 void TestMultiUserWindowManager::AddObserver(Observer* observer) { |
143 } | 148 } |
144 | 149 |
145 void TestMultiUserWindowManager::RemoveObserver(Observer* observer) { | 150 void TestMultiUserWindowManager::RemoveObserver(Observer* observer) { |
146 } | 151 } |
147 | 152 |
148 GURL GetGoogleURL() { | 153 GURL GetGoogleURL() { |
149 return GURL("http://www.google.com/"); | 154 return GURL("http://www.google.com/"); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 | 242 |
238 EXPECT_EQ(3u, chrome::GetTotalBrowserCount()); | 243 EXPECT_EQ(3u, chrome::GetTotalBrowserCount()); |
239 | 244 |
240 // The ShowWindowForUser should not have been called since the window is | 245 // The ShowWindowForUser should not have been called since the window is |
241 // already on the correct desktop. | 246 // already on the correct desktop. |
242 ASSERT_FALSE(manager->created_window()); | 247 ASSERT_FALSE(manager->created_window()); |
243 } | 248 } |
244 } | 249 } |
245 | 250 |
246 } // namespace | 251 } // namespace |
OLD | NEW |