| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_CHROME_LAUNCHER_CONTROLLER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_IMPL_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_IMPL_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_IMPL_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 const std::string& app_id, | 204 const std::string& app_id, |
| 205 int index, | 205 int index, |
| 206 ash::ShelfItemType shelf_item_type); | 206 ash::ShelfItemType shelf_item_type); |
| 207 | 207 |
| 208 // Invoked when the associated browser or app is closed. | 208 // Invoked when the associated browser or app is closed. |
| 209 void LauncherItemClosed(ash::ShelfID id); | 209 void LauncherItemClosed(ash::ShelfID id); |
| 210 | 210 |
| 211 // Internal helpers for pinning and unpinning that handle both | 211 // Internal helpers for pinning and unpinning that handle both |
| 212 // client-triggered and internal pinning operations. | 212 // client-triggered and internal pinning operations. |
| 213 void DoPinAppWithID(const std::string& app_id); | 213 void DoPinAppWithID(const std::string& app_id); |
| 214 void DoUnpinAppWithID(const std::string& app_id); | 214 void DoUnpinAppWithID(const std::string& app_id, bool update_prefs); |
| 215 | 215 |
| 216 // Pin a running app with |shelf_id| internally to |index|. It returns | 216 // Pin a running app with |shelf_id| internally to |index|. It returns |
| 217 // the index where the item was pinned. | 217 // the index where the item was pinned. |
| 218 int PinRunningAppInternal(int index, ash::ShelfID shelf_id); | 218 int PinRunningAppInternal(int index, ash::ShelfID shelf_id); |
| 219 | 219 |
| 220 // Unpin a locked application. This is an internal call which converts the | 220 // Unpin a locked application. This is an internal call which converts the |
| 221 // model type of the given app index from a shortcut into an unpinned running | 221 // model type of the given app index from a shortcut into an unpinned running |
| 222 // app. | 222 // app. |
| 223 void UnpinRunningAppInternal(int index); | 223 void UnpinRunningAppInternal(int index); |
| 224 | 224 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 // AppSyncUIStateObserver: | 302 // AppSyncUIStateObserver: |
| 303 void OnAppSyncUIStatusChanged() override; | 303 void OnAppSyncUIStatusChanged() override; |
| 304 | 304 |
| 305 // AppIconLoaderDelegate: | 305 // AppIconLoaderDelegate: |
| 306 void OnAppImageUpdated(const std::string& app_id, | 306 void OnAppImageUpdated(const std::string& app_id, |
| 307 const gfx::ImageSkia& image) override; | 307 const gfx::ImageSkia& image) override; |
| 308 | 308 |
| 309 // app_list::AppListSyncableService::Observer: | 309 // app_list::AppListSyncableService::Observer: |
| 310 void OnSyncModelUpdated() override; | 310 void OnSyncModelUpdated() override; |
| 311 | 311 |
| 312 // Unpins shelf item and optionally updates pin prefs when |update_prefs| is |
| 313 // set to true. |
| 314 void UnpinAndUpdatePrefs(ash::ShelfID id, bool update_prefs); |
| 315 |
| 312 ash::ShelfModel* model_; | 316 ash::ShelfModel* model_; |
| 313 | 317 |
| 314 // Profile used for prefs and loading extensions. This is NOT necessarily the | 318 // Profile used for prefs and loading extensions. This is NOT necessarily the |
| 315 // profile new windows are created with. | 319 // profile new windows are created with. |
| 316 Profile* profile_; | 320 Profile* profile_; |
| 317 | 321 |
| 318 // Controller items in this map are owned by |ShelfModel|. | 322 // Controller items in this map are owned by |ShelfModel|. |
| 319 IDToItemControllerMap id_to_item_controller_map_; | 323 IDToItemControllerMap id_to_item_controller_map_; |
| 320 | 324 |
| 321 // Direct access to app_id for a web contents. | 325 // Direct access to app_id for a web contents. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 typedef std::vector<std::string> RunningAppListIds; | 361 typedef std::vector<std::string> RunningAppListIds; |
| 358 typedef std::map<std::string, RunningAppListIds> RunningAppListIdMap; | 362 typedef std::map<std::string, RunningAppListIds> RunningAppListIdMap; |
| 359 RunningAppListIdMap last_used_running_application_order_; | 363 RunningAppListIdMap last_used_running_application_order_; |
| 360 | 364 |
| 361 base::WeakPtrFactory<ChromeLauncherControllerImpl> weak_ptr_factory_; | 365 base::WeakPtrFactory<ChromeLauncherControllerImpl> weak_ptr_factory_; |
| 362 | 366 |
| 363 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerImpl); | 367 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerImpl); |
| 364 }; | 368 }; |
| 365 | 369 |
| 366 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_IMPL_H_ | 370 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_IMPL_H_ |
| OLD | NEW |