OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_VIEWS_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 BrowserLauncherItemController* controller, | 98 BrowserLauncherItemController* controller, |
99 const std::string& app_id, | 99 const std::string& app_id, |
100 ash::LauncherItemStatus status); | 100 ash::LauncherItemStatus status); |
101 | 101 |
102 // Updates the running status of an item. | 102 // Updates the running status of an item. |
103 void SetItemStatus(ash::LauncherID id, ash::LauncherItemStatus status); | 103 void SetItemStatus(ash::LauncherID id, ash::LauncherItemStatus status); |
104 | 104 |
105 // Invoked when the underlying browser/app is closed. | 105 // Invoked when the underlying browser/app is closed. |
106 void LauncherItemClosed(ash::LauncherID id); | 106 void LauncherItemClosed(ash::LauncherID id); |
107 | 107 |
| 108 // Pins the specified id. Currently only supports platform apps. |
| 109 void Pin(ash::LauncherID id); |
| 110 |
108 // Unpins the specified id, closing if not running. | 111 // Unpins the specified id, closing if not running. |
109 void Unpin(ash::LauncherID id); | 112 void Unpin(ash::LauncherID id); |
110 | 113 |
111 // Returns true if the item identified by |id| is pinned. | 114 // Returns true if the item identified by |id| is pinned. |
112 bool IsPinned(ash::LauncherID id); | 115 bool IsPinned(ash::LauncherID id); |
113 | 116 |
114 // Pins/unpins the specified id. | 117 // Pins/unpins the specified id. |
115 void TogglePinned(ash::LauncherID id); | 118 void TogglePinned(ash::LauncherID id); |
116 | 119 |
117 // Returns true if the specified item can be pinned or unpinned. Only apps can | 120 // Returns true if the specified item can be pinned or unpinned. Only apps can |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 enum ItemType { | 217 enum ItemType { |
215 TYPE_APP, | 218 TYPE_APP, |
216 TYPE_TABBED_BROWSER | 219 TYPE_TABBED_BROWSER |
217 }; | 220 }; |
218 | 221 |
219 // Used to identity an item on the launcher. | 222 // Used to identity an item on the launcher. |
220 struct Item { | 223 struct Item { |
221 Item(); | 224 Item(); |
222 ~Item(); | 225 ~Item(); |
223 | 226 |
224 bool is_pinned() const { return controller == NULL; } | |
225 | |
226 // Type of item. | 227 // Type of item. |
227 ItemType item_type; | 228 ItemType item_type; |
228 | 229 |
229 // ID of the app. | 230 // ID of the app. |
230 std::string app_id; | 231 std::string app_id; |
231 | 232 |
232 // The BrowserLauncherItemController this item came from. NULL if a | 233 // The BrowserLauncherItemController this item came from. NULL if a |
233 // shortcut. | 234 // shortcut. |
234 BrowserLauncherItemController* controller; | 235 BrowserLauncherItemController* controller; |
235 }; | 236 }; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 | 296 |
296 content::NotificationRegistrar notification_registrar_; | 297 content::NotificationRegistrar notification_registrar_; |
297 | 298 |
298 PrefChangeRegistrar pref_change_registrar_; | 299 PrefChangeRegistrar pref_change_registrar_; |
299 aura::client::ActivationClient* activation_client_; | 300 aura::client::ActivationClient* activation_client_; |
300 | 301 |
301 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); | 302 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); |
302 }; | 303 }; |
303 | 304 |
304 #endif // CHROME_BROWSER_UI_VIEWS_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ | 305 #endif // CHROME_BROWSER_UI_VIEWS_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
OLD | NEW |