OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_EXTENSION_APP_WINDOW_LAUNCHER_CONTROLLER_
H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_EXTENSION_APP_WINDOW_LAUNCHER_CONTROLLER_
H_ |
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_EXTENSION_APP_WINDOW_LAUNCHER_CONTROLLER_
H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_EXTENSION_APP_WINDOW_LAUNCHER_CONTROLLER_
H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 | 11 |
| 12 #include "ash/public/cpp/shelf_types.h" |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
13 #include "chrome/browser/ui/ash/launcher/app_window_launcher_controller.h" | 14 #include "chrome/browser/ui/ash/launcher/app_window_launcher_controller.h" |
14 #include "extensions/browser/app_window/app_window_registry.h" | 15 #include "extensions/browser/app_window/app_window_registry.h" |
15 #include "ui/aura/window_observer.h" | 16 #include "ui/aura/window_observer.h" |
16 | 17 |
17 namespace aura { | 18 namespace aura { |
18 class Window; | 19 class Window; |
19 } | 20 } |
20 | 21 |
21 namespace extensions { | 22 namespace extensions { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 void RegisterApp(extensions::AppWindow* app_window); | 58 void RegisterApp(extensions::AppWindow* app_window); |
58 | 59 |
59 // Unregisters a app window with the shelf and this object. | 60 // Unregisters a app window with the shelf and this object. |
60 void UnregisterApp(aura::Window* window); | 61 void UnregisterApp(aura::Window* window); |
61 | 62 |
62 // Check if a given window is known to the launcher controller. | 63 // Check if a given window is known to the launcher controller. |
63 bool IsRegisteredApp(aura::Window* window); | 64 bool IsRegisteredApp(aura::Window* window); |
64 | 65 |
65 private: | 66 private: |
66 using AppControllerMap = | 67 using AppControllerMap = |
67 std::map<std::string, ExtensionAppWindowLauncherItemController*>; | 68 std::map<ash::ShelfID, ExtensionAppWindowLauncherItemController*>; |
68 using WindowToAppShelfIdMap = std::map<aura::Window*, std::string>; | |
69 | 69 |
70 // A set of unowned AppWindowRegistry pointers for loaded users. | 70 // A set of unowned AppWindowRegistry pointers for loaded users. |
71 // Note that this will only be used with multiple users in the side by side | 71 // Note that this will only be used with multiple users in the side by side |
72 // mode. | 72 // mode. |
73 std::set<extensions::AppWindowRegistry*> registry_; | 73 std::set<extensions::AppWindowRegistry*> registry_; |
74 | 74 |
75 // Map of app launcher id to controller. | 75 // Map of shelf id to controller. |
76 AppControllerMap app_controller_map_; | 76 AppControllerMap app_controller_map_; |
77 | 77 |
78 // Allows us to get from an aura::Window to the app shelf id. | 78 // Map of aura::Windows to shelf ids. |
79 WindowToAppShelfIdMap window_to_app_shelf_id_map_; | 79 std::map<aura::Window*, ash::ShelfID> window_to_shelf_id_map_; |
80 | 80 |
81 DISALLOW_COPY_AND_ASSIGN(ExtensionAppWindowLauncherController); | 81 DISALLOW_COPY_AND_ASSIGN(ExtensionAppWindowLauncherController); |
82 }; | 82 }; |
83 | 83 |
84 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_EXTENSION_APP_WINDOW_LAUNCHER_CONTROLL
ER_H_ | 84 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_EXTENSION_APP_WINDOW_LAUNCHER_CONTROLL
ER_H_ |
OLD | NEW |