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_ARC_APP_WINDOW_LAUNCHER_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_WINDOW_LAUNCHER_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_WINDOW_LAUNCHER_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_WINDOW_LAUNCHER_CONTROLLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
56 | 56 |
57 // ArcAppListPrefs::Observer: | 57 // ArcAppListPrefs::Observer: |
58 void OnAppReadyChanged(const std::string& app_id, bool ready) override; | 58 void OnAppReadyChanged(const std::string& app_id, bool ready) override; |
59 void OnAppRemoved(const std::string& app_id) override; | 59 void OnAppRemoved(const std::string& app_id) override; |
60 void OnTaskCreated(int task_id, | 60 void OnTaskCreated(int task_id, |
61 const std::string& package_name, | 61 const std::string& package_name, |
62 const std::string& activity) override; | 62 const std::string& activity) override; |
63 void OnTaskDestroyed(int task_id) override; | 63 void OnTaskDestroyed(int task_id) override; |
64 void OnTaskSetActive(int32_t task_id) override; | 64 void OnTaskSetActive(int32_t task_id) override; |
65 | 65 |
66 protected: | |
67 void StartObserving(Profile* profile); | |
68 void StopObserving(Profile* profile); | |
69 | |
70 private: | 66 private: |
71 class AppWindow; | 67 class AppWindow; |
72 | 68 |
73 using TaskIdToAppWindow = std::map<int, std::unique_ptr<AppWindow>>; | 69 using TaskIdToAppWindow = std::map<int, std::unique_ptr<AppWindow>>; |
74 using AppControllerMap = | 70 using AppControllerMap = |
75 std::map<std::string, ArcAppWindowLauncherItemController*>; | 71 std::map<std::string, ArcAppWindowLauncherItemController*>; |
76 | 72 |
73 void StartObserving(Profile* profile); | |
74 void StopObserving(Profile* profile); | |
75 | |
76 void RegisterApp(AppWindow* app_window); | |
77 void UnRegisterApp(AppWindow* app_window); | |
reveman
2016/06/03 21:51:47
nit: UnregisterApp
xdai1
2016/06/03 22:14:46
Done.
| |
78 | |
77 AppWindow* GetAppWindowForTask(int task_id); | 79 AppWindow* GetAppWindowForTask(int task_id); |
78 | 80 |
79 void CheckForAppWindowWidget(aura::Window* window); | 81 void CheckForAppWindowWidget(aura::Window* window); |
80 | 82 |
81 // AppWindowLauncherController: | 83 // AppWindowLauncherController: |
82 AppWindowLauncherItemController* ControllerForWindow( | 84 AppWindowLauncherItemController* ControllerForWindow( |
83 aura::Window* window) override; | 85 aura::Window* window) override; |
84 | 86 |
85 int active_task_id_ = -1; | 87 int active_task_id_ = -1; |
86 TaskIdToAppWindow task_id_to_app_window_; | 88 TaskIdToAppWindow task_id_to_app_window_; |
87 AppControllerMap app_controller_map_; | 89 AppControllerMap app_controller_map_; |
88 std::vector<aura::Window*> observed_windows_; | 90 std::vector<aura::Window*> observed_windows_; |
89 Profile* observed_profile_ = nullptr; | 91 Profile* observed_profile_ = nullptr; |
90 | 92 |
91 DISALLOW_COPY_AND_ASSIGN(ArcAppWindowLauncherController); | 93 DISALLOW_COPY_AND_ASSIGN(ArcAppWindowLauncherController); |
92 }; | 94 }; |
93 | 95 |
94 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_WINDOW_LAUNCHER_CONTROLLER_H_ | 96 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_WINDOW_LAUNCHER_CONTROLLER_H_ |
OLD | NEW |