| 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 |
| 11 #include "ash/common/shelf/shelf_delegate.h" | 11 #include "ash/common/shelf/shelf_delegate.h" |
| 12 #include "ash/common/shelf/shelf_model_observer.h" | 12 #include "ash/common/shelf/shelf_model_observer.h" |
| 13 #include "ash/display/window_tree_host_manager.h" | 13 #include "ash/display/window_tree_host_manager.h" |
| 14 #include "ash/public/cpp/shelf_types.h" | 14 #include "ash/public/cpp/shelf_types.h" |
| 15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
| 19 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" | 19 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" |
| 20 #include "chrome/browser/ui/ash/app_sync_ui_state_observer.h" | 20 #include "chrome/browser/ui/ash/app_sync_ui_state_observer.h" |
| 21 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" | 21 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" |
| 22 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 22 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| 23 #include "chrome/browser/ui/ash/launcher/launcher_app_updater.h" | 23 #include "chrome/browser/ui/ash/launcher/launcher_app_updater.h" |
| 24 #include "components/prefs/pref_change_registrar.h" | 24 #include "components/prefs/pref_change_registrar.h" |
| 25 #include "components/sync_preferences/pref_service_syncable_observer.h" |
| 25 #include "ui/aura/window_observer.h" | 26 #include "ui/aura/window_observer.h" |
| 26 | 27 |
| 27 class AppSyncUIState; | 28 class AppSyncUIState; |
| 28 class BrowserStatusMonitor; | 29 class BrowserStatusMonitor; |
| 29 class Profile; | 30 class Profile; |
| 30 class AppWindowLauncherController; | 31 class AppWindowLauncherController; |
| 31 class TabContents; | 32 class TabContents; |
| 32 | 33 |
| 33 namespace ash { | 34 namespace ash { |
| 34 class ShelfModel; | 35 class ShelfModel; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 55 // In addition to implementing ChromeLauncherController, this class performs | 56 // In addition to implementing ChromeLauncherController, this class performs |
| 56 // a lot of other responsibilities, such as implementing ash::ShelfDelegate, | 57 // a lot of other responsibilities, such as implementing ash::ShelfDelegate, |
| 57 // updating the UI state and the shelf model when apps are uninstalled, etc. | 58 // updating the UI state and the shelf model when apps are uninstalled, etc. |
| 58 class ChromeLauncherControllerImpl | 59 class ChromeLauncherControllerImpl |
| 59 : public ChromeLauncherController, | 60 : public ChromeLauncherController, |
| 60 public ash::ShelfDelegate, | 61 public ash::ShelfDelegate, |
| 61 public LauncherAppUpdater::Delegate, | 62 public LauncherAppUpdater::Delegate, |
| 62 private ash::ShelfModelObserver, | 63 private ash::ShelfModelObserver, |
| 63 private ash::WindowTreeHostManager::Observer, | 64 private ash::WindowTreeHostManager::Observer, |
| 64 private AppSyncUIStateObserver, | 65 private AppSyncUIStateObserver, |
| 65 private app_list::AppListSyncableService::Observer { | 66 private app_list::AppListSyncableService::Observer, |
| 67 private sync_preferences::PrefServiceSyncableObserver { |
| 66 public: | 68 public: |
| 67 ChromeLauncherControllerImpl(Profile* profile, ash::ShelfModel* model); | 69 ChromeLauncherControllerImpl(Profile* profile, ash::ShelfModel* model); |
| 68 ~ChromeLauncherControllerImpl() override; | 70 ~ChromeLauncherControllerImpl() override; |
| 69 | 71 |
| 70 // ChromeLauncherController: | 72 // ChromeLauncherController: |
| 71 void Init() override; | 73 void Init() override; |
| 72 ash::ShelfID CreateAppLauncherItem(LauncherItemController* controller, | 74 ash::ShelfID CreateAppLauncherItem(LauncherItemController* controller, |
| 73 const std::string& app_id, | 75 const std::string& app_id, |
| 74 ash::ShelfItemStatus status) override; | 76 ash::ShelfItemStatus status) override; |
| 75 void SetItemStatus(ash::ShelfID id, ash::ShelfItemStatus status) override; | 77 void SetItemStatus(ash::ShelfID id, ash::ShelfItemStatus status) override; |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 // AppSyncUIStateObserver: | 273 // AppSyncUIStateObserver: |
| 272 void OnAppSyncUIStatusChanged() override; | 274 void OnAppSyncUIStatusChanged() override; |
| 273 | 275 |
| 274 // AppIconLoaderDelegate: | 276 // AppIconLoaderDelegate: |
| 275 void OnAppImageUpdated(const std::string& app_id, | 277 void OnAppImageUpdated(const std::string& app_id, |
| 276 const gfx::ImageSkia& image) override; | 278 const gfx::ImageSkia& image) override; |
| 277 | 279 |
| 278 // app_list::AppListSyncableService::Observer: | 280 // app_list::AppListSyncableService::Observer: |
| 279 void OnSyncModelUpdated() override; | 281 void OnSyncModelUpdated() override; |
| 280 | 282 |
| 283 // sync_preferences::PrefServiceSyncableObserver: |
| 284 void OnIsSyncingChanged() override; |
| 285 |
| 281 // Unpins shelf item and optionally updates pin prefs when |update_prefs| is | 286 // Unpins shelf item and optionally updates pin prefs when |update_prefs| is |
| 282 // set to true. | 287 // set to true. |
| 283 void UnpinAndUpdatePrefs(ash::ShelfID id, bool update_prefs); | 288 void UnpinAndUpdatePrefs(ash::ShelfID id, bool update_prefs); |
| 284 | 289 |
| 285 ash::ShelfModel* model_; | 290 ash::ShelfModel* model_; |
| 286 | 291 |
| 287 // Controller items in this map are owned by |ShelfModel|. | 292 // Controller items in this map are owned by |ShelfModel|. |
| 288 IDToItemControllerMap id_to_item_controller_map_; | 293 IDToItemControllerMap id_to_item_controller_map_; |
| 289 | 294 |
| 290 // Direct access to app_id for a web contents. | 295 // Direct access to app_id for a web contents. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 320 typedef std::vector<std::string> RunningAppListIds; | 325 typedef std::vector<std::string> RunningAppListIds; |
| 321 typedef std::map<std::string, RunningAppListIds> RunningAppListIdMap; | 326 typedef std::map<std::string, RunningAppListIds> RunningAppListIdMap; |
| 322 RunningAppListIdMap last_used_running_application_order_; | 327 RunningAppListIdMap last_used_running_application_order_; |
| 323 | 328 |
| 324 base::WeakPtrFactory<ChromeLauncherControllerImpl> weak_ptr_factory_; | 329 base::WeakPtrFactory<ChromeLauncherControllerImpl> weak_ptr_factory_; |
| 325 | 330 |
| 326 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerImpl); | 331 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerImpl); |
| 327 }; | 332 }; |
| 328 | 333 |
| 329 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_IMPL_H_ | 334 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_IMPL_H_ |
| OLD | NEW |