| 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 20 matching lines...) Expand all Loading... |
| 31 public: | 31 public: |
| 32 TestMultiUserWindowManager( | 32 TestMultiUserWindowManager( |
| 33 Browser* visiting_browser, | 33 Browser* visiting_browser, |
| 34 const std::string& desktop_owner); | 34 const std::string& desktop_owner); |
| 35 virtual ~TestMultiUserWindowManager(); | 35 virtual ~TestMultiUserWindowManager(); |
| 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( | 42 virtual const std::string& GetWindowOwner( |
| 43 aura::Window* window) const OVERRIDE; | 43 aura::Window* window) const override; |
| 44 virtual void ShowWindowForUser( | 44 virtual void ShowWindowForUser( |
| 45 aura::Window* window, const std::string& user_id) OVERRIDE; | 45 aura::Window* window, const std::string& user_id) override; |
| 46 virtual bool AreWindowsSharedAmongUsers() const OVERRIDE; | 46 virtual bool AreWindowsSharedAmongUsers() const override; |
| 47 virtual void GetOwnersOfVisibleWindows( | 47 virtual void GetOwnersOfVisibleWindows( |
| 48 std::set<std::string>* user_ids) const OVERRIDE; | 48 std::set<std::string>* user_ids) const override; |
| 49 virtual bool IsWindowOnDesktopOfUser( | 49 virtual bool IsWindowOnDesktopOfUser( |
| 50 aura::Window* window, | 50 aura::Window* window, |
| 51 const std::string& user_id) const OVERRIDE; | 51 const std::string& user_id) const override; |
| 52 virtual const std::string& GetUserPresentingWindow( | 52 virtual const std::string& GetUserPresentingWindow( |
| 53 aura::Window* window) const OVERRIDE; | 53 aura::Window* window) const override; |
| 54 virtual void AddUser(content::BrowserContext* profile) OVERRIDE; | 54 virtual void AddUser(content::BrowserContext* profile) override; |
| 55 virtual void AddObserver(Observer* observer) OVERRIDE; | 55 virtual void AddObserver(Observer* observer) override; |
| 56 virtual void RemoveObserver(Observer* observer) OVERRIDE; | 56 virtual void RemoveObserver(Observer* observer) override; |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 // The window of the visiting browser. | 59 // The window of the visiting browser. |
| 60 aura::Window* browser_window_; | 60 aura::Window* browser_window_; |
| 61 // The owner of the visiting browser. | 61 // The owner of the visiting browser. |
| 62 std::string browser_owner_; | 62 std::string browser_owner_; |
| 63 // The owner of the currently shown desktop. | 63 // The owner of the currently shown desktop. |
| 64 std::string desktop_owner_; | 64 std::string desktop_owner_; |
| 65 // The created window. | 65 // The created window. |
| 66 aura::Window* created_window_; | 66 aura::Window* created_window_; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 void TestMultiUserWindowManager::RemoveObserver(Observer* observer) { | 147 void TestMultiUserWindowManager::RemoveObserver(Observer* observer) { |
| 148 } | 148 } |
| 149 | 149 |
| 150 GURL GetGoogleURL() { | 150 GURL GetGoogleURL() { |
| 151 return GURL("http://www.google.com/"); | 151 return GURL("http://www.google.com/"); |
| 152 } | 152 } |
| 153 | 153 |
| 154 // Subclass that tests navigation while in the Guest session. | 154 // Subclass that tests navigation while in the Guest session. |
| 155 class BrowserGuestSessionNavigatorTest: public BrowserNavigatorTest { | 155 class BrowserGuestSessionNavigatorTest: public BrowserNavigatorTest { |
| 156 protected: | 156 protected: |
| 157 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 157 virtual void SetUpCommandLine(CommandLine* command_line) override { |
| 158 CommandLine command_line_copy = *command_line; | 158 CommandLine command_line_copy = *command_line; |
| 159 command_line_copy.AppendSwitchASCII( | 159 command_line_copy.AppendSwitchASCII( |
| 160 chromeos::switches::kLoginProfile, "user"); | 160 chromeos::switches::kLoginProfile, "user"); |
| 161 chromeos::GetOffTheRecordCommandLine(GetGoogleURL(), | 161 chromeos::GetOffTheRecordCommandLine(GetGoogleURL(), |
| 162 true, | 162 true, |
| 163 command_line_copy, | 163 command_line_copy, |
| 164 command_line); | 164 command_line); |
| 165 } | 165 } |
| 166 }; | 166 }; |
| 167 | 167 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 240 |
| 241 EXPECT_EQ(3u, chrome::GetTotalBrowserCount()); | 241 EXPECT_EQ(3u, chrome::GetTotalBrowserCount()); |
| 242 | 242 |
| 243 // The ShowWindowForUser should not have been called since the window is | 243 // The ShowWindowForUser should not have been called since the window is |
| 244 // already on the correct desktop. | 244 // already on the correct desktop. |
| 245 ASSERT_FALSE(manager->created_window()); | 245 ASSERT_FALSE(manager->created_window()); |
| 246 } | 246 } |
| 247 } | 247 } |
| 248 | 248 |
| 249 } // namespace | 249 } // namespace |
| OLD | NEW |