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 <set> | 10 #include <set> |
(...skipping 25 matching lines...) Expand all Loading... |
36 #include "ui/aura/window_observer.h" | 36 #include "ui/aura/window_observer.h" |
37 | 37 |
38 class AppSyncUIState; | 38 class AppSyncUIState; |
39 class Browser; | 39 class Browser; |
40 class BrowserShortcutLauncherItemController; | 40 class BrowserShortcutLauncherItemController; |
41 class BrowserStatusMonitor; | 41 class BrowserStatusMonitor; |
42 class ExtensionEnableFlow; | 42 class ExtensionEnableFlow; |
43 class GURL; | 43 class GURL; |
44 class LauncherItemController; | 44 class LauncherItemController; |
45 class Profile; | 45 class Profile; |
46 class ShellWindowLauncherController; | 46 class AppWindowLauncherController; |
47 class TabContents; | 47 class TabContents; |
48 | 48 |
49 namespace ash { | 49 namespace ash { |
50 class ShelfItemDelegateManager; | 50 class ShelfItemDelegateManager; |
51 class ShelfModel; | 51 class ShelfModel; |
52 } | 52 } |
53 | 53 |
54 namespace aura { | 54 namespace aura { |
55 class Window; | 55 class Window; |
56 } | 56 } |
(...skipping 23 matching lines...) Expand all Loading... |
80 private: | 80 private: |
81 | 81 |
82 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerUserSwitchObserver); | 82 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerUserSwitchObserver); |
83 }; | 83 }; |
84 | 84 |
85 // ChromeLauncherController manages the launcher items needed for content | 85 // ChromeLauncherController manages the launcher items needed for content |
86 // windows. Launcher items have a type, an optional app id, and a controller. | 86 // windows. Launcher items have a type, an optional app id, and a controller. |
87 // This incarnation groups running tabs/windows in application specific lists. | 87 // This incarnation groups running tabs/windows in application specific lists. |
88 // * Browser app windows have BrowserLauncherItemController, owned by the | 88 // * Browser app windows have BrowserLauncherItemController, owned by the |
89 // BrowserView instance. | 89 // BrowserView instance. |
90 // * App shell windows have ShellWindowLauncherItemController, owned by | 90 // * App windows have AppWindowLauncherItemController, owned by |
91 // ShellWindowLauncherController. | 91 // AppWindowLauncherController. |
92 // * Shortcuts have no LauncherItemController. | 92 // * Shortcuts have no LauncherItemController. |
93 class ChromeLauncherController : public ash::ShelfDelegate, | 93 class ChromeLauncherController : public ash::ShelfDelegate, |
94 public ash::ShelfModelObserver, | 94 public ash::ShelfModelObserver, |
95 public ash::ShellObserver, | 95 public ash::ShellObserver, |
96 public ash::DisplayController::Observer, | 96 public ash::DisplayController::Observer, |
97 public content::NotificationObserver, | 97 public content::NotificationObserver, |
98 public extensions::AppIconLoader::Delegate, | 98 public extensions::AppIconLoader::Delegate, |
99 public PrefServiceSyncableObserver, | 99 public PrefServiceSyncableObserver, |
100 public AppSyncUIStateObserver, | 100 public AppSyncUIStateObserver, |
101 public ExtensionEnableFlowDelegate, | 101 public ExtensionEnableFlowDelegate, |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 LauncherItemController* GetLauncherItemController(const ash::ShelfID id); | 380 LauncherItemController* GetLauncherItemController(const ash::ShelfID id); |
381 | 381 |
382 // Returns true if |browser| is owned by the active user. | 382 // Returns true if |browser| is owned by the active user. |
383 bool IsBrowserFromActiveUser(Browser* browser); | 383 bool IsBrowserFromActiveUser(Browser* browser); |
384 | 384 |
385 // Access to the BrowserStatusMonitor for tests. | 385 // Access to the BrowserStatusMonitor for tests. |
386 BrowserStatusMonitor* browser_status_monitor_for_test() { | 386 BrowserStatusMonitor* browser_status_monitor_for_test() { |
387 return browser_status_monitor_.get(); | 387 return browser_status_monitor_.get(); |
388 } | 388 } |
389 | 389 |
390 // Access to the ShellWindowController for tests. | 390 // Access to the AppWindowLauncherController for tests. |
391 ShellWindowLauncherController* shell_window_controller_for_test() { | 391 AppWindowLauncherController* app_window_controller_for_test() { |
392 return shell_window_controller_.get(); | 392 return app_window_controller_.get(); |
393 } | 393 } |
394 | 394 |
395 protected: | 395 protected: |
396 // Creates a new app shortcut item and controller on the shelf at |index|. | 396 // Creates a new app shortcut item and controller on the shelf at |index|. |
397 // Use kInsertItemAtEnd to add a shortcut as the last item. | 397 // Use kInsertItemAtEnd to add a shortcut as the last item. |
398 ash::ShelfID CreateAppShortcutLauncherItem(const std::string& app_id, | 398 ash::ShelfID CreateAppShortcutLauncherItem(const std::string& app_id, |
399 int index); | 399 int index); |
400 | 400 |
401 // Sets the AppTabHelper/AppIconLoader, taking ownership of the helper class. | 401 // Sets the AppTabHelper/AppIconLoader, taking ownership of the helper class. |
402 // These are intended for testing. | 402 // These are intended for testing. |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 Profile* profile_; | 548 Profile* profile_; |
549 | 549 |
550 IDToItemControllerMap id_to_item_controller_map_; | 550 IDToItemControllerMap id_to_item_controller_map_; |
551 | 551 |
552 // Maintains activation order of web contents for each app. | 552 // Maintains activation order of web contents for each app. |
553 AppIDToWebContentsListMap app_id_to_web_contents_list_; | 553 AppIDToWebContentsListMap app_id_to_web_contents_list_; |
554 | 554 |
555 // Direct access to app_id for a web contents. | 555 // Direct access to app_id for a web contents. |
556 WebContentsToAppIDMap web_contents_to_app_id_; | 556 WebContentsToAppIDMap web_contents_to_app_id_; |
557 | 557 |
558 // Used to track shell windows. | 558 // Used to track app windows. |
559 scoped_ptr<ShellWindowLauncherController> shell_window_controller_; | 559 scoped_ptr<AppWindowLauncherController> app_window_controller_; |
560 | 560 |
561 // Used to get app info for tabs. | 561 // Used to get app info for tabs. |
562 scoped_ptr<AppTabHelper> app_tab_helper_; | 562 scoped_ptr<AppTabHelper> app_tab_helper_; |
563 | 563 |
564 // Used to load the image for an app item. | 564 // Used to load the image for an app item. |
565 scoped_ptr<extensions::AppIconLoader> app_icon_loader_; | 565 scoped_ptr<extensions::AppIconLoader> app_icon_loader_; |
566 | 566 |
567 content::NotificationRegistrar notification_registrar_; | 567 content::NotificationRegistrar notification_registrar_; |
568 | 568 |
569 PrefChangeRegistrar pref_change_registrar_; | 569 PrefChangeRegistrar pref_change_registrar_; |
(...skipping 20 matching lines...) Expand all Loading... |
590 // The list of running & un-pinned applications for different users on hidden | 590 // The list of running & un-pinned applications for different users on hidden |
591 // desktops. | 591 // desktops. |
592 typedef std::vector<std::string> RunningAppListIds; | 592 typedef std::vector<std::string> RunningAppListIds; |
593 typedef std::map<std::string, RunningAppListIds> RunningAppListIdMap; | 593 typedef std::map<std::string, RunningAppListIds> RunningAppListIdMap; |
594 RunningAppListIdMap last_used_running_application_order_; | 594 RunningAppListIdMap last_used_running_application_order_; |
595 | 595 |
596 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); | 596 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); |
597 }; | 597 }; |
598 | 598 |
599 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ | 599 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ |
OLD | NEW |