1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WINDOW_MANAGER_TEST_H_
6 #define CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WINDOW_MANAGER_TEST_H_
8 #include "base/macros.h"
9 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h"
11 // This is a test implementation of a MultiUserWindowManager which allows to
12 // test a visiting window on another desktop. It will install and remove itself
13 // from the system upon creation / destruction.
14 // The creation function gets a |browser| which is shown on |desktop_owner|'s
16 class TestMultiUserWindowManager
: public chrome::MultiUserWindowManager
{
18 TestMultiUserWindowManager(Browser
* visiting_browser
,
19 const std::string
& desktop_owner
);
20 ~TestMultiUserWindowManager() override
;
22 aura::Window
* created_window() { return created_window_
; }
24 // MultiUserWindowManager overrides:
25 void SetWindowOwner(aura::Window
* window
,
26 const std::string
& user_id
) override
;
27 const std::string
& GetWindowOwner(aura::Window
* window
) const override
;
28 void ShowWindowForUser(aura::Window
* window
,
29 const std::string
& user_id
) override
;
30 bool AreWindowsSharedAmongUsers() const override
;
31 void GetOwnersOfVisibleWindows(
32 std::set
<std::string
>* user_ids
) const override
;
33 bool IsWindowOnDesktopOfUser(aura::Window
* window
,
34 const std::string
& user_id
) const override
;
35 const std::string
& GetUserPresentingWindow(
36 aura::Window
* window
) const override
;
37 void AddUser(content::BrowserContext
* profile
) override
;
38 void AddObserver(Observer
* observer
) override
;
39 void RemoveObserver(Observer
* observer
) override
;
42 // The window of the visiting browser.
43 aura::Window
* browser_window_
;
44 // The owner of the visiting browser.
45 std::string browser_owner_
;
46 // The owner of the currently shown desktop.
47 std::string desktop_owner_
;
48 // The created window.
49 aura::Window
* created_window_
;
50 // The location of the window.
51 std::string created_window_shown_for_
;
52 // The current selected active user.
53 std::string current_user_id_
;
55 DISALLOW_COPY_AND_ASSIGN(TestMultiUserWindowManager
);
58 #endif // CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WINDOW_MANAGER_TEST_H_