OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_APP_WINDOW_LAUNCHER_ITEM_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_APP_WINDOW_LAUNCHER_ITEM_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_APP_WINDOW_LAUNCHER_ITEM_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_APP_WINDOW_LAUNCHER_ITEM_CONTROLLER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 virtual void OnWindowPropertyChanged(aura::Window* window, | 70 virtual void OnWindowPropertyChanged(aura::Window* window, |
71 const void* key, | 71 const void* key, |
72 intptr_t old) OVERRIDE; | 72 intptr_t old) OVERRIDE; |
73 | 73 |
74 // Get the number of running applications/incarnations of this. | 74 // Get the number of running applications/incarnations of this. |
75 size_t app_window_count() const { return app_windows_.size(); } | 75 size_t app_window_count() const { return app_windows_.size(); } |
76 | 76 |
77 // Activates the window at position |index|. | 77 // Activates the window at position |index|. |
78 void ActivateIndexedApp(size_t index); | 78 void ActivateIndexedApp(size_t index); |
79 | 79 |
| 80 // Install the app. Only valid for ephemeral apps, which can be promoted to |
| 81 // regular installed apps. |
| 82 void InstallApp(); |
| 83 |
80 private: | 84 private: |
81 typedef std::list<apps::AppWindow*> AppWindowList; | 85 typedef std::list<apps::AppWindow*> AppWindowList; |
82 | 86 |
83 void ShowAndActivateOrMinimize(apps::AppWindow* app_window); | 87 void ShowAndActivateOrMinimize(apps::AppWindow* app_window); |
84 | 88 |
85 // Activate the given |window_to_show|, or - if already selected - advance to | 89 // Activate the given |window_to_show|, or - if already selected - advance to |
86 // the next window of similar type. | 90 // the next window of similar type. |
87 void ActivateOrAdvanceToNextAppWindow(apps::AppWindow* window_to_show); | 91 void ActivateOrAdvanceToNextAppWindow(apps::AppWindow* window_to_show); |
88 | 92 |
89 // List of associated app windows | 93 // List of associated app windows |
90 AppWindowList app_windows_; | 94 AppWindowList app_windows_; |
91 | 95 |
92 // Pointer to the most recently active app window | 96 // Pointer to the most recently active app window |
93 apps::AppWindow* last_active_app_window_; | 97 apps::AppWindow* last_active_app_window_; |
94 | 98 |
95 // The launcher id associated with this set of windows. There is one | 99 // The launcher id associated with this set of windows. There is one |
96 // AppLauncherItemController for each |app_shelf_id_|. | 100 // AppLauncherItemController for each |app_shelf_id_|. |
97 const std::string app_shelf_id_; | 101 const std::string app_shelf_id_; |
98 | 102 |
99 // Scoped list of observed windows (for removal on destruction) | 103 // Scoped list of observed windows (for removal on destruction) |
100 ScopedObserver<aura::Window, aura::WindowObserver> observed_windows_; | 104 ScopedObserver<aura::Window, aura::WindowObserver> observed_windows_; |
101 | 105 |
102 DISALLOW_COPY_AND_ASSIGN(AppWindowLauncherItemController); | 106 DISALLOW_COPY_AND_ASSIGN(AppWindowLauncherItemController); |
103 }; | 107 }; |
104 | 108 |
105 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_APP_WINDOW_LAUNCHER_ITEM_CONTROLLER_H_ | 109 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_APP_WINDOW_LAUNCHER_ITEM_CONTROLLER_H_ |
OLD | NEW |