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