| 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_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "base/compiler_specific.h" | 21 #include "base/compiler_specific.h" |
| 22 #include "base/macros.h" | 22 #include "base/macros.h" |
| 23 #include "base/memory/scoped_vector.h" | 23 #include "base/memory/scoped_vector.h" |
| 24 #include "build/build_config.h" | 24 #include "build/build_config.h" |
| 25 #include "chrome/browser/ui/app_icon_loader.h" | 25 #include "chrome/browser/ui/app_icon_loader.h" |
| 26 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" | 26 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" |
| 27 #include "chrome/browser/ui/ash/app_sync_ui_state_observer.h" | 27 #include "chrome/browser/ui/ash/app_sync_ui_state_observer.h" |
| 28 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h" | 28 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h" |
| 29 #include "chrome/browser/ui/ash/launcher/chrome_launcher_types.h" | 29 #include "chrome/browser/ui/ash/launcher/chrome_launcher_types.h" |
| 30 #include "chrome/browser/ui/ash/launcher/launcher_app_updater.h" | 30 #include "chrome/browser/ui/ash/launcher/launcher_app_updater.h" |
| 31 #include "chrome/browser/ui/extensions/extension_enable_flow_delegate.h" | |
| 32 #include "components/prefs/pref_change_registrar.h" | 31 #include "components/prefs/pref_change_registrar.h" |
| 33 #include "components/syncable_prefs/pref_service_syncable_observer.h" | 32 #include "components/syncable_prefs/pref_service_syncable_observer.h" |
| 34 #include "extensions/common/constants.h" | 33 #include "extensions/common/constants.h" |
| 35 #include "ui/aura/window_observer.h" | 34 #include "ui/aura/window_observer.h" |
| 36 | 35 |
| 37 class AppSyncUIState; | 36 class AppSyncUIState; |
| 38 class Browser; | 37 class Browser; |
| 39 class BrowserShortcutLauncherItemController; | 38 class BrowserShortcutLauncherItemController; |
| 40 class BrowserStatusMonitor; | 39 class BrowserStatusMonitor; |
| 41 class ExtensionEnableFlow; | |
| 42 class GURL; | 40 class GURL; |
| 43 class LauncherControllerHelper; | 41 class LauncherControllerHelper; |
| 44 class LauncherItemController; | 42 class LauncherItemController; |
| 45 class Profile; | 43 class Profile; |
| 46 class AppWindowLauncherController; | 44 class AppWindowLauncherController; |
| 47 class TabContents; | 45 class TabContents; |
| 48 | 46 |
| 49 namespace ash { | 47 namespace ash { |
| 50 class ShelfItemDelegateManager; | 48 class ShelfItemDelegateManager; |
| 51 class ShelfModel; | 49 class ShelfModel; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // * App windows have AppWindowLauncherItemController, owned by | 81 // * App windows have AppWindowLauncherItemController, owned by |
| 84 // AppWindowLauncherController. | 82 // AppWindowLauncherController. |
| 85 // * Shortcuts have no LauncherItemController. | 83 // * Shortcuts have no LauncherItemController. |
| 86 class ChromeLauncherController | 84 class ChromeLauncherController |
| 87 : public ash::ShelfDelegate, | 85 : public ash::ShelfDelegate, |
| 88 public ash::ShelfModelObserver, | 86 public ash::ShelfModelObserver, |
| 89 public ash::WindowTreeHostManager::Observer, | 87 public ash::WindowTreeHostManager::Observer, |
| 90 public AppIconLoaderDelegate, | 88 public AppIconLoaderDelegate, |
| 91 public syncable_prefs::PrefServiceSyncableObserver, | 89 public syncable_prefs::PrefServiceSyncableObserver, |
| 92 public AppSyncUIStateObserver, | 90 public AppSyncUIStateObserver, |
| 93 public ExtensionEnableFlowDelegate, | |
| 94 public LauncherAppUpdater::Delegate, | 91 public LauncherAppUpdater::Delegate, |
| 95 public ash::ShelfItemDelegateManagerObserver { | 92 public ash::ShelfItemDelegateManagerObserver { |
| 96 public: | 93 public: |
| 97 // Indicates if a shelf item is incognito or not. | 94 // Indicates if a shelf item is incognito or not. |
| 98 enum IncognitoState { | 95 enum IncognitoState { |
| 99 STATE_INCOGNITO, | 96 STATE_INCOGNITO, |
| 100 STATE_NOT_INCOGNITO, | 97 STATE_NOT_INCOGNITO, |
| 101 }; | 98 }; |
| 102 | 99 |
| 103 // Used to update the state of non plaform apps, as web contents change. | 100 // Used to update the state of non plaform apps, as web contents change. |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 const std::string& app_id) override; | 280 const std::string& app_id) override; |
| 284 void OnAppUninstalled(content::BrowserContext* browser_context, | 281 void OnAppUninstalled(content::BrowserContext* browser_context, |
| 285 const std::string& app_id) override; | 282 const std::string& app_id) override; |
| 286 | 283 |
| 287 // syncable_prefs::PrefServiceSyncableObserver: | 284 // syncable_prefs::PrefServiceSyncableObserver: |
| 288 void OnIsSyncingChanged() override; | 285 void OnIsSyncingChanged() override; |
| 289 | 286 |
| 290 // AppSyncUIStateObserver: | 287 // AppSyncUIStateObserver: |
| 291 void OnAppSyncUIStatusChanged() override; | 288 void OnAppSyncUIStatusChanged() override; |
| 292 | 289 |
| 293 // ExtensionEnableFlowDelegate: | |
| 294 void ExtensionEnableFlowFinished() override; | |
| 295 void ExtensionEnableFlowAborted(bool user_initiated) override; | |
| 296 | |
| 297 // AppIconLoaderDelegate: | 290 // AppIconLoaderDelegate: |
| 298 void OnAppImageUpdated(const std::string& app_id, | 291 void OnAppImageUpdated(const std::string& app_id, |
| 299 const gfx::ImageSkia& image) override; | 292 const gfx::ImageSkia& image) override; |
| 300 | 293 |
| 301 // Called when the active user has changed. | 294 // Called when the active user has changed. |
| 302 void ActiveUserChanged(const std::string& user_email); | 295 void ActiveUserChanged(const std::string& user_email); |
| 303 | 296 |
| 304 // Called when a user got added to the session. | 297 // Called when a user got added to the session. |
| 305 void AdditionalUserAddedToSession(Profile* profile); | 298 void AdditionalUserAddedToSession(Profile* profile); |
| 306 | 299 |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 // Used to load the images for app items. | 522 // Used to load the images for app items. |
| 530 std::vector<std::unique_ptr<AppIconLoader>> app_icon_loaders_; | 523 std::vector<std::unique_ptr<AppIconLoader>> app_icon_loaders_; |
| 531 | 524 |
| 532 // Used to handle app load/unload events. | 525 // Used to handle app load/unload events. |
| 533 std::vector<std::unique_ptr<LauncherAppUpdater>> app_updaters_; | 526 std::vector<std::unique_ptr<LauncherAppUpdater>> app_updaters_; |
| 534 | 527 |
| 535 PrefChangeRegistrar pref_change_registrar_; | 528 PrefChangeRegistrar pref_change_registrar_; |
| 536 | 529 |
| 537 AppSyncUIState* app_sync_ui_state_; | 530 AppSyncUIState* app_sync_ui_state_; |
| 538 | 531 |
| 539 std::unique_ptr<ExtensionEnableFlow> extension_enable_flow_; | |
| 540 | |
| 541 // The owned browser status monitor. | 532 // The owned browser status monitor. |
| 542 std::unique_ptr<BrowserStatusMonitor> browser_status_monitor_; | 533 std::unique_ptr<BrowserStatusMonitor> browser_status_monitor_; |
| 543 | 534 |
| 544 #if defined(OS_CHROMEOS) | 535 #if defined(OS_CHROMEOS) |
| 545 // A special observer class to detect user switches. | 536 // A special observer class to detect user switches. |
| 546 std::unique_ptr<ChromeLauncherControllerUserSwitchObserver> | 537 std::unique_ptr<ChromeLauncherControllerUserSwitchObserver> |
| 547 user_switch_observer_; | 538 user_switch_observer_; |
| 548 #endif | 539 #endif |
| 549 | 540 |
| 550 // If true, incoming pinned state changes should be ignored. | 541 // If true, incoming pinned state changes should be ignored. |
| 551 bool ignore_persist_pinned_state_change_; | 542 bool ignore_persist_pinned_state_change_; |
| 552 | 543 |
| 553 // The list of running & un-pinned applications for different users on hidden | 544 // The list of running & un-pinned applications for different users on hidden |
| 554 // desktops. | 545 // desktops. |
| 555 typedef std::vector<std::string> RunningAppListIds; | 546 typedef std::vector<std::string> RunningAppListIds; |
| 556 typedef std::map<std::string, RunningAppListIds> RunningAppListIdMap; | 547 typedef std::map<std::string, RunningAppListIds> RunningAppListIdMap; |
| 557 RunningAppListIdMap last_used_running_application_order_; | 548 RunningAppListIdMap last_used_running_application_order_; |
| 558 | 549 |
| 559 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); | 550 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); |
| 560 }; | 551 }; |
| 561 | 552 |
| 562 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ | 553 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
| OLD | NEW |