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 <map> | 10 #include <map> |
10 #include <string> | 11 #include <string> |
11 | 12 |
12 #include "ash/launcher/launcher_delegate.h" | 13 #include "ash/launcher/launcher_delegate.h" |
13 #include "ash/launcher/launcher_model_observer.h" | 14 #include "ash/launcher/launcher_model_observer.h" |
14 #include "ash/launcher/launcher_types.h" | 15 #include "ash/launcher/launcher_types.h" |
15 #include "ash/wm/shelf_auto_hide_behavior.h" | 16 #include "ash/wm/shelf_auto_hide_behavior.h" |
16 #include "base/basictypes.h" | 17 #include "base/basictypes.h" |
17 #include "base/compiler_specific.h" | 18 #include "base/compiler_specific.h" |
18 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 }; |
235 | 236 |
236 typedef std::map<ash::LauncherID, Item> IDToItemMap; | 237 typedef std::map<ash::LauncherID, Item> IDToItemMap; |
237 typedef std::map<aura::Window*, ash::LauncherID> WindowToIDMap; | 238 typedef std::map<aura::Window*, ash::LauncherID> WindowToIDMap; |
| 239 typedef std::list<aura::Window*> WindowList; |
238 | 240 |
239 // Updates the pinned pref state. The pinned state consists of a list pref. | 241 // Updates the pinned pref state. The pinned state consists of a list pref. |
240 // Each item of the list is a dictionary. The key |kAppIDPath| gives the | 242 // Each item of the list is a dictionary. The key |kAppIDPath| gives the |
241 // id of the app. | 243 // id of the app. |
242 void PersistPinnedState(); | 244 void PersistPinnedState(); |
243 | 245 |
244 // Sets the AppIconLoader, taking ownership of |loader|. This is intended for | 246 // Sets the AppIconLoader, taking ownership of |loader|. This is intended for |
245 // testing. | 247 // testing. |
246 void SetAppIconLoaderForTest(AppIconLoader* loader); | 248 void SetAppIconLoaderForTest(AppIconLoader* loader); |
247 | 249 |
(...skipping 29 matching lines...) Expand all Loading... |
277 | 279 |
278 // Profile used for prefs and loading extensions. This is NOT necessarily the | 280 // Profile used for prefs and loading extensions. This is NOT necessarily the |
279 // profile new windows are created with. | 281 // profile new windows are created with. |
280 Profile* profile_; | 282 Profile* profile_; |
281 | 283 |
282 IDToItemMap id_to_item_map_; | 284 IDToItemMap id_to_item_map_; |
283 | 285 |
284 // Allows us to get from an aura::Window to the id of a launcher item. | 286 // Allows us to get from an aura::Window to the id of a launcher item. |
285 // Currently only used for platform app windows. | 287 // Currently only used for platform app windows. |
286 WindowToIDMap window_to_id_map_; | 288 WindowToIDMap window_to_id_map_; |
| 289 // Maintains the activation order. The first element is most recent. |
| 290 // Currently only used for platform app windows. |
| 291 WindowList activation_order_; |
287 | 292 |
288 // Used to load the image for an app tab. | 293 // Used to load the image for an app tab. |
289 scoped_ptr<AppIconLoader> app_icon_loader_; | 294 scoped_ptr<AppIconLoader> app_icon_loader_; |
290 | 295 |
291 content::NotificationRegistrar notification_registrar_; | 296 content::NotificationRegistrar notification_registrar_; |
292 | 297 |
293 PrefChangeRegistrar pref_change_registrar_; | 298 PrefChangeRegistrar pref_change_registrar_; |
294 aura::client::ActivationClient* activation_client_; | 299 aura::client::ActivationClient* activation_client_; |
295 | 300 |
296 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); | 301 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); |
297 }; | 302 }; |
298 | 303 |
299 #endif // CHROME_BROWSER_UI_VIEWS_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ | 304 #endif // CHROME_BROWSER_UI_VIEWS_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
OLD | NEW |