Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / ui / ash / launcher / multi_profile_app_window_launcher_controller.h
blobd998ab64d677341fad79259142fbae59ae168a1c
1 // Copyright 2014 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_LAUNCHER_MULTI_PROFILE_APP_WINDOW_LAUNCHER_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_MULTI_PROFILE_APP_WINDOW_LAUNCHER_CONTROLLER_H_
8 #include "chrome/browser/ui/ash/launcher/app_window_launcher_controller.h"
10 // Inherits from AppWindowLauncherController and overwrites the AppWindow
11 // observing functions to switch between users dynamically.
12 class MultiProfileAppWindowLauncherController
13 : public AppWindowLauncherController {
14 public:
15 explicit MultiProfileAppWindowLauncherController(
16 ChromeLauncherController* owner);
17 ~MultiProfileAppWindowLauncherController() override;
19 // Overridden from AppWindowLauncherController:
20 void ActiveUserChanged(const std::string& user_email) override;
21 void AdditionalUserAddedToSession(Profile* profile) override;
23 // Overridden from AppWindowRegistry::Observer:
24 void OnAppWindowAdded(extensions::AppWindow* app_window) override;
25 void OnAppWindowRemoved(extensions::AppWindow* app_window) override;
26 void OnAppWindowShown(extensions::AppWindow* app_window,
27 bool was_hidden) override;
28 void OnAppWindowHidden(extensions::AppWindow* app_window) override;
30 private:
31 typedef std::vector<extensions::AppWindow*> AppWindowList;
32 typedef std::vector<extensions::AppWindowRegistry*> AppWindowRegistryList;
34 // Returns true if the owner of the given |app_window| has a window teleported
35 // of the |app_window|'s application type to the current desktop.
36 bool UserHasAppOnActiveDesktop(extensions::AppWindow* app_window);
38 // A list of all app windows for all users.
39 AppWindowList app_window_list_;
41 // A list of the app window registries which we additionally observe.
42 AppWindowRegistryList multi_user_registry_;
44 DISALLOW_COPY_AND_ASSIGN(MultiProfileAppWindowLauncherController);
47 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_MULTI_PROFILE_APP_WINDOW_LAUNCHER_CONTROLLER_H_