- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / ash / launcher / multi_profile_shell_window_launcher_controller.h
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_MULTI_PROFILE_SHELL_WINDOW_LAUNCHER_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_MULTI_PROFILE_SHELL_WINDOW_LAUNCHER_CONTROLLER_H_
7
8 #include "chrome/browser/ui/ash/launcher/shell_window_launcher_controller.h"
9
10 // Inherits from ShellWindowLauncherController and overwrites the ShellWindow
11 // observing functions to switch between users dynamically.
12 class MultiProfileShellWindowLauncherController
13     : public ShellWindowLauncherController {
14  public:
15   explicit MultiProfileShellWindowLauncherController(
16       ChromeLauncherController* owner);
17   virtual ~MultiProfileShellWindowLauncherController();
18
19   // Overridden from ShellWindowLauncherController:
20   virtual void ActiveUserChanged(const std::string& user_email) OVERRIDE;
21   virtual void AdditionalUserAddedToSession(Profile* profile) OVERRIDE;
22
23   // Overridden from ShellWindowRegistry::Observer:
24   virtual void OnShellWindowAdded(apps::ShellWindow* shell_window) OVERRIDE;
25   virtual void OnShellWindowRemoved(apps::ShellWindow* shell_window) OVERRIDE;
26
27  private:
28   typedef std::vector<apps::ShellWindow*> ShellWindowList;
29   typedef std::vector<apps::ShellWindowRegistry*> ShellWindowRegistryList;
30
31   // Returns true when the given window is from the active user.
32   bool IsShellWindowFromActiveUser(apps::ShellWindow* shell_window);
33
34   // A list of all shell windows for all users.
35   ShellWindowList shell_window_list_;
36
37   // A list of the shell window registries which we additionally observe.
38   ShellWindowRegistryList multi_user_registry_;
39
40   DISALLOW_COPY_AND_ASSIGN(MultiProfileShellWindowLauncherController);
41 };
42
43 #endif  // CHROME_BROWSER_UI_ASH_LAUNCHER_MULTI_PROFILE_SHELL_WINDOW_LAUNCHER_CONTROLLER_H_